Refining and restructuring the test cases#266
Conversation
|
Seems reasonable. If we're going to mess with tests, perhaps we can also choose a snapshot testing tool. There are a lot of options out there since snapshot testing in .NET seems to be in its infancy. I have started to evaluate some in https://twitter.com/RehanSaeedUK/status/1375470767475982336?s=20. So far, I'm leaning towards Verify but still doing some reading. |
|
Hmmm, I was looking into Verify but I'm not sure exactly how it (or tools like it) would fit in with what we have. Like you mentioned in #100, what we have for a number of the tests are good examples for different things - that's fine, just not sure where tests using a snapshot testing tool help us. Happy to give it a shot though might need to understand more where it fits in and how. |
|
Hmmm, I thought a snapshot tool would be useful to get rid of the JSON strings but now that I look at it, because we do serialize and deserialize tests, we need the JSON string. Ok, ignore me then. |
|
Any other thoughts with this PR? Happy to have it merged? |
|
LGTM |
|
Good time to release? |
|
Sounds good to me! Will do some more stuff with S.T.J soon and maybe open a PR to support pending types like we discussed. |
Changes
ToStringtest (avoids issues with JSON property order) however a round trip conversion test (convert to JSON and back to object) still exists for each proving that theToStringmethod works.MixedTypesTesthas moved to examples folder (mainly because the logic behind it is tested inValuesJsonConverterTesthowever seemed worth keeping as an example)SerializationTesthave been moved intoThingTestwithSerializationTestbeing deletedSchemaSerializerinstead of directly usingJsonConvert(this is the ideal way people will serialize our types and is what we directly call inThing.ToString())Overall nothing overly major has changed one way or another but it should eliminate the issue in #100 where tests failed due to JSON order while making a few other bits a little clearer.