public void SetBodyWithWithAnIAModelWithFloatPropertyTest() { IAModelWithFloatProperty model = new IAModelWithFloatProperty(); model.Number = 5.434f; IADeSerialization deSerialization = new IADeSerialization(); deSerialization.SetBodyWith(model); Assert.AreEqual("{\"Number\":5.434}", deSerialization.BodyAsString()); }
public void BodyAsIAModelWithFloatPropertyTest() { IAModelWithFloatProperty expected = new IAModelWithFloatProperty(); expected.Number = 5.434f; IADeSerialization deSerialization = new IADeSerialization(); deSerialization.SetBodyWith(expected); IAModelWithFloatProperty actual = deSerialization.BodyAs <IAModelWithFloatProperty>(); Assert.AreEqual(expected, actual); }
public void StringBodyAsNumberTest() { IAModelWithFloatProperty expected = new IAModelWithFloatProperty(); expected.Number = 50.6f; IADeSerialization deSerialization = new IADeSerialization(); deSerialization.SetBodyWith("{\"number\":\"50.6\"}"); IAModelWithFloatProperty actual = deSerialization.BodyAs <IAModelWithFloatProperty>(); Assert.AreEqual(expected, actual); }
public override bool Equals(Object obj) { if (this == obj) { return(true); } if (obj == null || (obj as IAModelWithFloatProperty) == null) { return(false); } IAModelWithFloatProperty model = (IAModelWithFloatProperty)obj; return(this.Number == model.Number); }
public void SetBodyWithWithAnIAModelWithFloatPropertyTest() { IAModelWithFloatProperty model = new IAModelWithFloatProperty(); model.Number = 5.434f; IADeSerialization deSerialization = new IADeSerialization(); deSerialization.SetBodyWith(model); Assert.AreEqual("{\"Number\":5.434}", deSerialization.BodyAsString()); }
public void BodyAsIAModelWithFloatPropertyTest() { IAModelWithFloatProperty expected = new IAModelWithFloatProperty(); expected.Number = 5.434f; IADeSerialization deSerialization = new IADeSerialization(); deSerialization.SetBodyWith(expected); IAModelWithFloatProperty actual = deSerialization.BodyAs<IAModelWithFloatProperty>(); Assert.AreEqual(expected, actual); }
public void StringBodyAsNumberTest() { IAModelWithFloatProperty expected = new IAModelWithFloatProperty(); expected.Number = 50.6f; IADeSerialization deSerialization = new IADeSerialization(); deSerialization.SetBodyWith("{\"number\":\"50.6\"}"); IAModelWithFloatProperty actual = deSerialization.BodyAs<IAModelWithFloatProperty>(); Assert.AreEqual(expected, actual); }