I could get the code to compile on my machine. I was trying to understand the code from the bottom. Since the schema and encoding/decoding at the very bottom, the following comments apply to those parts of the code. Please bear with me, it'll take a while to go through the whole codebase. Since we wish and hope that the code will live for several years, a couple of weeks spent in getting it right should be worth it.
Most of the tests passed on my machine, some failed. One test even crashes NTest UI.
The class hierarchy of Schema is:
It's not clear why only NullSchema and BooleanSchema are specified and the rest of the primitive schemas are left alone. I think a a more appropriate hierarchy would be:
Instead of having SchemaType as a string, it'd be better to have it as an enum, which, unlike string, is close-ended.
Testing appears inadequate. In TestSchema, for example the test only covers parsing.
In the Encoder and Decoder interfaces, we are accepting the Stream in every function. Typically, a lot of encoding/decoding happens on the same stream. So attaching the stream the interface once will be better, the way we do in the Java implementation.
I see some files have both Windows and Unix line-endings. I don't know where the problem is. Do you think keeping Windows line-ending throughout will keep us from these troubles?
Most of the places the tabs are expanded into spaces, which is perfect. But certain tabs seem to have escaped. We try to avoid hard-tabs.
We can save quite a bit of code if we use parameterized tests. There is attempt to achieve parameterization in TestSchema. But it leads to some problems, I think. When tests fail, it becomes hard to find which test has failed.
I tired to capture all the above ideas (regarding the Schema not encoder/decoder) by refactoring the code. I kept it at firstname.lastname@example.org:thirumg/Avro.NET.git in the master branch.
Please feel free to pull it and try. I have commented out certain tests and code in Avrogen because of this refactroing. Please don't mistake me, my intention was not to arbitrarily change your code. I thought some ideas are better shown by demonstration rather than pages and pages of text.
Please let me know what you think.
Do you have any suggestion for a code coverage tool? It'll be nice to know how much coverage we get with our tests.