Is there any point Unit testing serialization?

后端 未结 13 922
慢半拍i
慢半拍i 2021-02-01 23:38

I have a class that serializes a set of objects (using XML serialization) that I want to unit test.

My problem is it feels like I will be testing the .NET implementation

相关标签:
13条回答
  • 2021-02-02 00:37

    We do acceptance testing of our serialization rather than unit testing.

    What this means is that our acceptance testers take the XML schema, or as in your case some sample XML, and re-create their own serializable data-transfer class.

    We then use NUnit to test our WCF service with this clean-room XML.

    With this technique we've identified many, many errors. For example, where we have changed the name of the .NET member and forgotten to add an [XmlElement] tag with a Name = property.

    0 讨论(0)
提交回复
热议问题