示例#1
0
        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());
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
        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);
        }