Inheritance: ObjectWithProperties
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }