Skip to content
Merged
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 @@ -157,6 +157,7 @@ public async Task ReadFromStreamAsync_RoundTripsWriteToStreamAsync_KnownTypes(Ty
}
}

#if !NETCOREAPP2_0 // DBNull not serializable on .NET Core 2.0.
// Test alternate null value
[Fact]
public async Task ReadFromStreamAsync_RoundTripsWriteToStreamAsync_DBNull()
Expand Down Expand Up @@ -187,6 +188,7 @@ public async Task ReadFromStreamAsync_RoundTripsWriteToStreamAsync_DBNullAsEmpty
// Lower levels convert DBNull.Value to empty string on read
Assert.Equal(String.Empty, readObj);
}
#endif

[Fact]
public async Task UseDataContractJsonSerializer_Default()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,23 @@ public class XmlMediaTypeFormatterTests : MediaTypeFormatterTestBase<XmlMediaTyp
// sample only; avoids types DataContractJsonSerializer fails to round trip (e.g. Guid, Uint16). May require
// known types or similar (de)serializer configuration.
public static readonly RefTypeTestData<object> BunchOfTypedObjectsTestData = new RefTypeTestData<object>(
() => new List<object> { null, String.Empty, "This is a string", false, true, Double.MinValue,
Double.MaxValue, Int32.MinValue, Int32.MaxValue, Int64.MinValue, Int64.MaxValue, DBNull.Value, });
() => new List<object>
{
null,
String.Empty,
"This is a string",
false,
true,
Double.MinValue,
Double.MaxValue,
Int32.MinValue,
Int32.MaxValue,
Int64.MinValue,
Int64.MaxValue,
#if !NETCOREAPP2_0 // DBNull not serializable on .NET Core 2.0.
DBNull.Value,
#endif
});

public static IEnumerable<TestData> BunchOfTypedObjectsTestDataCollection
{
Expand Down