Closed samcragg closed 8 years ago
I've just moved the test to AutoMessagePackSerializerTest.ttinclude (and removed the [Serializable]
as requested) and it looks like some of the new generated tests fail (I think I've focused on one area that was causing me pain but the unit tests cover far more edge cases that need fixing first).
Let me investigate and I'll add a new commit with the changes before anything gets merged
I'm trying to add tests for error cases, so I found some extra issues on your PR. Sorry for taking back what I said, please check my comments. In addition, I will fix and push some bugs they prevent your fix working correctly in an hour.
Here are the instructions and requests to testing:
NonCollectionType
AlwaysAssumeCollections
is not set to default, SerializationException
is thrown. This case should also be added for non generic variant.NonCollectionType
and non generic counter parts to AutoMessagePackSerializerTest.Types.tt
.PreGeneratedSerializerActivator.Types.tt
, put result.Add( typeof( ... ) );
in the end of the method (after #endif
) for both of generic one and non generic one.PreGenerateSerializerGenerator.cs
, remove comment out of the [Test]
. And execute the GenerateFiles
method, then MessagePack_Serialization_xxx.cs
(xxx is type name of generic one and non generic one) will be generated in %SystemDrive%\temp-gen
. Move the files to MsgPack.UnitTest\gen
folder.PreGenerateSerializerGenerator.GenerateFiles()
test. New files will be generated in %SystemDrive%\temp-gen35
. Move the files to MsgPackUnitTest.Net35\gen
folder.Thank you for great work! I merged with a few tweaking.
This is designed to fix issue #169
I've added a compatibility option to disable the new behaviour (
AlwaysAssumeCollections
) and all the unit tests to pass with the refactored code, plus there's an additional one showing the desired behaviour.Since this is my first pull request let me know if there's anything you need me to do