Open
Description
Describe the bug
Today, MSTest uses the DataContractJsonSerializer
serializer in order to perform the serialization and deserialization of the data during discovery and execution.
The problem with current solution is that it requires custom objects to be marked with DataContractAttribute
/DataMemberAttribute
which isn't what user expects to do or to be doing for the sake of test.
At the moment, the BinaryFormatter
seems to be the best option but it's not ideal as this formatter has a lot of security concerns associated (see https://learn.microsoft.com/dotnet/api/system.runtime.serialization.formatters.binary.binaryformatter#remarks)
Additional context
Related issues:
- MS Test 2.2.4 - 2.2.10: Tests fail because DynamicData gets only structs with default values (MS Test 2.2.4 - 2.2.10: Tests fail because DynamicData gets only structs with default values #1094)
- wrong value received by test method with ITestDataSource and values of struct with property of nullable primitive type (wrong value received by test method with ITestDataSource and values of struct with property of nullable primitive type #1022)
- DynamicData test is not passing exception objects correctly (DynamicData test is not passing exception objects correctly #1037)
- Using an interface in dynamic data causes a de-/serialization exception (Using an interface in dynamic data causes a de-/serialization exception #908)
- DateTime equality test fails after upgrading from 2.2.3 ([MSTest][Discovery] MSTestPlayground.exe Failed to discover tests from assembly (After upgrade from 2.1.2 to 2.2.8) #1019)
- Using dynamic data source method fails to work (Using dynamic data source method fails to work #1588)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment