public void ShouldSerializeDatesAccodingToIso8601() { var entity = new JsonObjectTests.User(timestamp: new DateTime(2011, 06, 01, 12, 04, 34, 444, DateTimeKind.Utc)); dynamic fragment = NewtonsoftSerializer.SerializeAsJsonObject(entity); Assert.Equal("2011-06-01T12:04:34.444Z", (string)fragment.timestamp); }
public void ShouldConvertPropertyNameToCamelCase() { var entity = new JsonObjectTests.User(name: "john"); dynamic fragment = NewtonsoftSerializer.SerializeAsJsonObject(entity); Assert.NotNull((string)fragment.name); }
public void ShouldSerializeEnumsAsString() { var entity = new JsonObjectTests.User(sex: JsonObjectTests.UserSex.Female); dynamic fragment = NewtonsoftSerializer.SerializeAsJsonObject(entity); Assert.Equal("Female", (string)fragment.sex); }
public void ShouldSerializePublicFields() { var entity = new JsonObjectTests.User { Field = "quantum mechanics" }; dynamic fragment = NewtonsoftSerializer.SerializeAsJsonObject(entity); Assert.Equal("quantum mechanics", (string)fragment.field); }
public void ShouldSerializePublicFields() { var entity = new JsonObjectTests.User { Field = "quantum mechanics" }; dynamic fragment = NewtonsoftSerializer.SerializeAsJsonObject(entity); Assert.Equal("quantum mechanics", (string)fragment.field); }
public void ShouldSerializeEnumsAsString() { var entity = new JsonObjectTests.User(sex: JsonObjectTests.UserSex.Female); dynamic fragment = NewtonsoftSerializer.SerializeAsJsonObject(entity); Assert.Equal("Female", (string)fragment.sex); }
public void ShouldSerializeDatesAccodingToIso8601() { var entity = new JsonObjectTests.User(timestamp: new DateTime(2011, 06, 01, 12, 04, 34, 444, DateTimeKind.Utc)); dynamic fragment = NewtonsoftSerializer.SerializeAsJsonObject(entity); Assert.Equal("2011-06-01T12:04:34.444Z", (string)fragment.timestamp); }
public void ShouldConvertPropertyNameToCamelCase() { var entity = new JsonObjectTests.User(name: "john"); dynamic fragment = NewtonsoftSerializer.SerializeAsJsonObject(entity); Assert.NotNull((string)fragment.name); }