Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ public async Task DataRowsShouldHandleNonSerializableValues()
// Assert
VerifyE2E.TestsDiscovered(
testCases,
"DataRowNonSerializable");
"DataRowNonSerializable (System.String)",
"DataRowNonSerializable (System.Int32)",
"DataRowNonSerializable (DataRowTestProject.DataRowTests_DerivedClass)");

VerifyE2E.TestsPassed(
testResults,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,32 @@
actual[0]!.Equals(source).Should().BeTrue();
}
#endif

public void DataSerializerShouldRoundTripSystemType()
{
Type[] source = [typeof(Console), typeof(DataSerializationHelperTests), typeof(DataSerializationHelper)];

foreach (Type type in source)
{
object?[]? actual = DataSerializationHelper.Deserialize(DataSerializationHelper.Serialize([type]));

Check failure on line 91 in test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/DataSerializationHelperTests.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build Windows Debug)

test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/DataSerializationHelperTests.cs#L91

test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/DataSerializationHelperTests.cs(91,1): error : [DataSerializerShouldRoundTripSystemType] [net462] DataContractJsonSerializer does not support the setting of the FullTypeName of the object to be serialized to a value other than the default FullTypeName. Attempted to serialize object with full type name 'System.UnitySerializationHolder' and default full type name 'System.RuntimeType'.

Check failure on line 91 in test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/DataSerializationHelperTests.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build Windows Release)

test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/DataSerializationHelperTests.cs#L91

test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/DataSerializationHelperTests.cs(91,1): error : [DataSerializerShouldRoundTripSystemType] [net462] DataContractJsonSerializer does not support the setting of the FullTypeName of the object to be serialized to a value other than the default FullTypeName. Attempted to serialize object with full type name 'System.UnitySerializationHolder' and default full type name 'System.RuntimeType'.

Check failure on line 91 in test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/DataSerializationHelperTests.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx

test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/DataSerializationHelperTests.cs#L91

test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/DataSerializationHelperTests.cs(91,1): error : [DataSerializerShouldRoundTripSystemType] [net462] DataContractJsonSerializer does not support the setting of the FullTypeName of the object to be serialized to a value other than the default FullTypeName. Attempted to serialize object with full type name 'System.UnitySerializationHolder' and default full type name 'System.RuntimeType'.

actual!.Length.Should().Be(1);
actual[0].Should().Be(type);
}
}

public void DataSerializerShouldRoundTripMixedPayloadIncludingSystemType()
{
object?[] source = [typeof(string), 42, "hello", null, new DateTime(638450000000000000)];

object?[]? actual = DataSerializationHelper.Deserialize(DataSerializationHelper.Serialize(source));

Check failure on line 102 in test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/DataSerializationHelperTests.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build Windows Debug)

test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/DataSerializationHelperTests.cs#L102

test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/DataSerializationHelperTests.cs(102,1): error : [DataSerializerShouldRoundTripMixedPayloadIncludingSystemType] [net462] DataContractJsonSerializer does not support the setting of the FullTypeName of the object to be serialized to a value other than the default FullTypeName. Attempted to serialize object with full type name 'System.UnitySerializationHolder' and default full type name 'System.RuntimeType'.

Check failure on line 102 in test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/DataSerializationHelperTests.cs

View check run for this annotation

Azure Pipelines / microsoft.testfx (Build Windows Release)

test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/DataSerializationHelperTests.cs#L102

test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/DataSerializationHelperTests.cs(102,1): error : [DataSerializerShouldRoundTripMixedPayloadIncludingSystemType] [net462] DataContractJsonSerializer does not support the setting of the FullTypeName of the object to be serialized to a value other than the default FullTypeName. Attempted to serialize object with full type name 'System.UnitySerializationHolder' and default full type name 'System.RuntimeType'.

actual.Should().NotBeNull();
actual!.Length.Should().Be(source.Length);
actual[0].Should().Be(typeof(string));
actual[1].Should().Be(42);
actual[2].Should().Be("hello");
actual[3].Should().BeNull();
actual[4].Should().Be(source[4]);
}
}
Loading