public void ShouldSerializeEnumByPrimitiveValue() { const Formatting target = Formatting.None; const string expected = "0"; JsonAssert.SerializesTo(target, expected); }
public void ShouldSerializeObjectWithTypeName() { var target = new SerializationTestTarget { Id = "42" }; const string expected = "{\"$type\":\"" + TestTargetTypeName + "\",\"Id\":\"42\"}"; JsonAssert.SerializesTo(target, expected); }
public void ShouldNotSerializeNullProperty() { // ReSharper disable once AssignNullToNotNullAttribute var target = new SerializationTestTarget { Id = null }; const string expected = "{\"$type\":\"" + TestTargetTypeName + "\"}"; JsonAssert.SerializesTo(target, expected); }
public void ShouldSerializeNull() { JsonAssert.SerializesTo((object)null, "null"); }