Beispiel #1
0
        public void EqualsOfIdenticalObjectsReturnsTrue()
        {
            // Fixture setup
            var value = new QuadrupleParameterType <string, string, string, string>("Lorem", "ipsum", "dolor", "sit");
            var other = new QuadrupleParameterType <string, string, string, string>("Lorem", "ipsum", "dolor", "sit");

            // The rest of the test
            SemanticComparerTest.CompareSemantically(value, other, true);
        }
Beispiel #2
0
        public void EqualsOfDifferentObjectsReturnFalse()
        {
            // Fixture setup
            var value = new QuadrupleParameterType <string, string, string, string>("Lorem", "ipsum", "dolor", "sit");
            var other = new QuadrupleParameterType <string, string, string, string>("amet", "consectetur", "adipisicing", "elit");

            // The rest of the test
            SemanticComparerTest.CompareSemantically(value, other, false);
        }
Beispiel #3
0
        public void SemanticComparisonAgainstObjectWithOverloadedMembersWillNotThrow()
        {
            // Fixture setup
            var likenObject = new object();

            var comparee = new TypeWithOverloadedMembers();

            // The rest of the test
            SemanticComparerTest.CompareSemantically(likenObject, comparee, false);
        }
Beispiel #4
0
        public void SemanticComparisonAgainstObjectWithIndexerWillNotThrow()
        {
            // Fixture setup
            var likenObject = new object();

            var comparee = new TypeWithIndexer();

            // The rest of the test
            SemanticComparerTest.CompareSemantically(likenObject, comparee, true);
        }
Beispiel #5
0
        public void SemanticallyAnObjectWithPropertyWillNotBeEqualToPropertyWithDifferentProperty()
        {
            // Fixture setup
            var likenObject = new { SomeOtherProperty = new object() };

            PropertyHolder <object> comparee = new PropertyHolder <object>();

            comparee.Property = new object();

            // The rest of the test
            SemanticComparerTest.CompareSemantically(likenObject, comparee, false);
        }
Beispiel #6
0
        public void SemanticallyAnObjectWithValuePropertyWillNotBeEqualToObjectWithNullProperty()
        {
            // Fixture setup
            PropertyHolder <object> likenObject = new PropertyHolder <object>();

            likenObject.Property = new object();

            PropertyHolder <object> comparee = new PropertyHolder <object>();

            comparee.Property = null;

            // The rest of the test
            SemanticComparerTest.CompareSemantically(likenObject, comparee, false);
        }
Beispiel #7
0
        public void ObjectsWithNullPropertiesAreSemanticallyEqual()
        {
            // Fixture setup
            PropertyHolder <object> likenObject = new PropertyHolder <object>();

            likenObject.Property = null;

            PropertyHolder <object> comparee = new PropertyHolder <object>();

            comparee.Property = null;

            // The rest of the test
            SemanticComparerTest.CompareSemantically(likenObject, comparee, true);
        }
Beispiel #8
0
        public void ComparingStringFieldHolderSemanticallyToRealStringFieldHolderWillIndicateEquality()
        {
            // Fixture setup
            string anonymousText = "Anonymous text";

            FieldHolder <string> likenObject = new FieldHolder <string>();

            likenObject.Field = anonymousText;

            FieldHolder <string> comparee = new FieldHolder <string>();

            comparee.Field = anonymousText;

            // The rest of the test
            SemanticComparerTest.CompareSemantically(likenObject, comparee, true);
        }
Beispiel #9
0
        public void CompareAnonymousTypeSemanticallyToStringFieldHolderWillIndicateEqualityWhenValuesAreEqual()
        {
            // Fixture setup
            string anonymousText = "Anonymous text";

            var likenObject = new
            {
                Field = anonymousText
            };

            FieldHolder <string> comparee = new FieldHolder <string>();

            comparee.Field = anonymousText;

            // The rest of the test
            SemanticComparerTest.CompareSemantically(likenObject, comparee, true);
        }
Beispiel #10
0
        public void ComparingStringFieldHoldersWithDifferentValuesWillIndicateDifference()
        {
            // Fixture setup
            string anonymousText1 = "Anonymous text";
            string anonymousText2 = "Some other text";

            FieldHolder <string> likenObject = new FieldHolder <string>();

            likenObject.Field = anonymousText1;

            FieldHolder <string> comparee = new FieldHolder <string>();

            comparee.Field = anonymousText2;

            // The rest of the test
            SemanticComparerTest.CompareSemantically(likenObject, comparee, false);
        }
Beispiel #11
0
        public void CompareAnonymousTypeSemanticallyToStringPropertyHolderWillIndicateDifferenceWhenValuesAreDifferent()
        {
            // Fixture setup
            string anonymousText1 = "Anonymous text";
            string anonymousText2 = "Some other text";

            var likenObject = new
            {
                Field = anonymousText1
            };

            FieldHolder <string> comparee = new FieldHolder <string>();

            comparee.Field = anonymousText2;

            // The rest of the test
            SemanticComparerTest.CompareSemantically(likenObject, comparee, false);
        }