public void PrimitiveFieldsNullableClassTest()
        {
            PrimitiveFieldsNullable obj1 = new PrimitiveFieldsNullable();

            obj1.Setup();
            byte[] bytes = _serializer.Serialize(obj1);
            obj1.ClearStatic();
            PrimitiveFieldsNullable obj2 = _serializer.Deserialize <PrimitiveFieldsNullable>(bytes);

            if (!_compare.Compare(obj1, obj2))
            {
                throw new Exception(_compare.DifferencesString);
            }
        }
Ejemplo n.º 2
0
        public void DifferentNullableDecimalFieldsShouldNotBeEqualWhenCompareChildrenIsFalse()
        {
            CompareLogic compareLogic = new CompareLogic();

            compareLogic.Config.CompareChildren = false;

            PrimitiveFieldsNullable object1 = new PrimitiveFieldsNullable();

            object1.DecimalField = 0;

            PrimitiveFieldsNullable object2 = new PrimitiveFieldsNullable();

            object2.DecimalField = 3.0M;

            Assert.IsFalse(compareLogic.Compare(object1, object2).AreEqual);
        }
        public void PrimitiveFieldsNullableListTest()
        {
            List <PrimitiveFieldsNullable> list1 = new List <PrimitiveFieldsNullable>();

            PrimitiveFieldsNullable obj1 = new PrimitiveFieldsNullable();

            obj1.Setup();
            list1.Add(obj1);

            byte[] bytes = _serializer.Serialize(list1);
            obj1.ClearStatic();
            List <PrimitiveFieldsNullable> list2 = _serializer.Deserialize <List <PrimitiveFieldsNullable> >(bytes);

            if (!_compare.Compare(list1, list2))
            {
                throw new Exception(_compare.DifferencesString);
            }
        }