-
Notifications
You must be signed in to change notification settings - Fork 291
Closed
Milestone
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)
- [DataRow]: Original nested types are lost when nested deeper than one level ([DataRow]: Original nested types are lost when nested deeper than one level #2390)
- Bug(?) when using a struct with DynamicDataAttribute #3259
- Getting DataSource object right is very difficult #1054
- DynamicData test with parameter struct having implicit conversion to string leads to corrupted parameter #3962
tYoshiyuki, cbersch, scharnyw, h3xds1nz and KotMSymbioticKilla