Beispiel #1
0
        public void SetBodyWithWithAnIAModelReferenceTest()
        {
            IAModelWithIntProperty intprop = new IAModelWithIntProperty();

            intprop.Number = 50;
            IAModelReference model = new IAModelReference();

            model.Number = intprop;
            IADeSerialization deSerialization = new IADeSerialization();

            deSerialization.SetBodyWith(model);
            Assert.AreEqual("{\"Number\":{\"Number\":50}}", deSerialization.BodyAsString());
        }
Beispiel #2
0
        public void BodyAsIAModelReferenceTest()
        {
            IAModelWithIntProperty model = new IAModelWithIntProperty();

            model.Number = 50;
            IAModelReference expected = new IAModelReference();

            expected.Number = model;
            IADeSerialization deSerialization = new IADeSerialization();

            deSerialization.SetBodyWith(expected);
            IAModelReference actual = deSerialization.BodyAs <IAModelReference>();

            Assert.AreEqual(expected, actual);
        }
Beispiel #3
0
        public override bool Equals(Object obj)
        {
            if (this == obj)
            {
                return(true);
            }

            if (obj == null || (obj as IAModelReference) == null)
            {
                return(false);
            }

            IAModelReference model = (IAModelReference)obj;

            return((this.Number == model.Number) || (this.Number != null && this.Number.Equals(model.Number)));
        }
 public void SetBodyWithWithAnIAModelReferenceTest()
 {
     IAModelWithIntProperty intprop = new IAModelWithIntProperty();
     intprop.Number = 50;
     IAModelReference model = new IAModelReference();
     model.Number = intprop;
     IADeSerialization deSerialization = new IADeSerialization();
     deSerialization.SetBodyWith(model);
     Assert.AreEqual("{\"Number\":{\"Number\":50}}", deSerialization.BodyAsString());
 }
 public void BodyAsIAModelReferenceTest()
 {
     IAModelWithIntProperty model = new IAModelWithIntProperty();
     model.Number = 50;
     IAModelReference expected = new IAModelReference();
     expected.Number = model;
     IADeSerialization deSerialization = new IADeSerialization();
     deSerialization.SetBodyWith(expected);
     IAModelReference actual = deSerialization.BodyAs<IAModelReference>();
     Assert.AreEqual(expected, actual);
 }