Inheritance: ObjectWithProperties
Beispiel #1
0
        public void ObjectWithNestedObjectMatches()
        {
            var a = new NestingObject
            {
                Number = 2,
                String = "string",
                SomeIntProperty = 2,
                SomeObject = new ObjectWithProperties
                {
                    Number = 2,
                    String = "string"
                }
            };

            var b = new NestingObject
            {
                Number = 2,
                String = "string",
                SomeObject = new ObjectWithProperties
                {
                    Number = 2,
                    String = "string"
                }
            };


            var result = _calculator.Diff(a, b);

            Assert.True(result.ValuesMatch);
        }
Beispiel #2
0
        public void ObjectWithNestedObjectDoesNotMatch()
        {
            var a = new NestingObject
            {
                Number = 2,
                String = "string",
                SomeObject = new ObjectWithProperties
                {
                    Number = 2,
                    String = "string"
                }
            };

            var b = new NestingObject
            {
                Number = 2,
                String = "string",
                SomeObject = new ObjectWithProperties
                {
                    Number = 2,
                    String = "some other string"
                }
            };


            var result = _calculator.Diff(a, b);

            Assert.False(result.ValuesMatch);
        }