public void Serialize_WhenPrivateSetterExists_IsSerialized() { var entity = new JsonEntity(); entity.SetName("Daniel"); var json = _jsonSerializer.Serialize(entity); Assert.AreEqual("{\"Name\":\"Daniel\"}", json); }
public void ToJsonOrEmptyString_WhenPrivateSetterExists_IsSerialized() { var entity = new JsonEntity(); entity.SetName("Daniel"); var json = JsonSerialization.ToJsonOrEmptyString(entity); Assert.AreEqual("{\"Name\":\"Daniel\"}", json); }
public override void Serialize_WhenPrivateSetterExists_IsSerialized() { var entity = new JsonEntity(); entity.SetName("Daniel"); entity.SetAge(32); var json = Serializer.Serialize(entity); Assert.AreEqual("{\"Name\":\"Daniel\",\"Age\":32}", json); }
public override void Serialize_WhenPrivateSetterExists_IsSerialized() { var entity = new JsonEntity(); entity.SetName("Daniel"); entity.SetAge(32); var json = Serializer.Serialize(entity); Assert.AreEqual("{\"StructureId\":0,\"Name\":\"Daniel\",\"Age\":32}", json); }