コード例 #1
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);
        }
コード例 #2
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);
        }
コード例 #3
0
        public void SemanticComparisonAgainstDataErrorInfoWillNotThrow()
        {
            // Fixture setup
            var likenObject = new DataErrorInfo();

            var comparee = new DataErrorInfo();

            // The rest of the test
            SemanticComparerTest.CompareSemantically(likenObject, comparee, true);
        }
コード例 #4
0
        public void SemanticComparisonAgainstObjectWithOverloadedMembersWillNotThrow()
        {
            // Fixture setup
            var likenObject = new object();

            var comparee = new TypeWithOverloadedMembers();

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

            var comparee = new TypeWithIndexer();

            // The rest of the test
            SemanticComparerTest.CompareSemantically(likenObject, comparee, true);
        }
コード例 #6
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);
        }
コード例 #7
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);
        }
コード例 #8
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);
        }
コード例 #9
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);
        }
コード例 #10
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);
        }
コード例 #11
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);
        }
コード例 #12
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);
        }