Exemplo n.º 1
0
        public void AutoMerge_ArrayOfDifferentLengthsSucceeds()
        {
            TestObject previousObj      = BuildObjectStructure();
            TestObject currentObj       = BuildObjectStructure();
            int        countBeforeMerge = currentObj.TestArrayOfReferences.Length;

            AnotherTestObject obj = previousObj.TestArrayOfReferences[0];

            obj.TestNullableValue             = null;
            previousObj.TestArrayOfReferences = new AnotherTestObject[] { obj };

            AutoMerge.Merge(ref currentObj, previousObj);
            bool isSuccessfulTest = (
                currentObj.TestArrayOfReferences.Length == countBeforeMerge &&
                currentObj.TestArrayOfReferences[0].TestNullableValue == null
                );

            Assert.True(
                isSuccessfulTest,
                $"Expected array size {countBeforeMerge}\nActual {currentObj.TestArrayOfReferences.Length}"
                );
        }
Exemplo n.º 2
0
        public override bool Equals(object a)
        {
            AnotherTestObject tempA = (AnotherTestObject)a;

            return(this == tempA);
        }