예제 #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);
        }
예제 #5
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());
 }
예제 #6
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);
 }
예제 #7
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);
        }