コード例 #1
0
ファイル: DataLayer.cs プロジェクト: j-burrows/repository
        public void BusinessUnit_TwoIdenticalPolymorphs_AreNotEquivilant()
        {
            //Arrange: Two business identical polymorphic units are created
            IDataUnit normal = new MockDataUnit { attrOne = 1, attrTwo = "1", attrThree = 1 };
            IDataUnit polymorph = new MockPolymorphicDataUnit { attrOne = 1, attrTwo = "1", attrThree = 1 };

            //Act: Compare the two via equivilance
            bool equal = normal.Equivilant(polymorph);

            //Assert: The two are not equal.
            Assert.AreEqual(equal, false);
        }
コード例 #2
0
ファイル: DataLayer.cs プロジェクト: j-burrows/repository
        public void DataUnit_TwoIdentical_AreEquivilant()
        {
            //Arrange: Create two matching data units
            MockDataUnit alpha = new MockDataUnit { key = 1, attrTwo="One", attrThree=3};
            MockDataUnit beta = new MockDataUnit { key = 1, attrTwo="One", attrThree=2};

            //Act: Compare the two via equivilance
            bool equal = alpha.Equivilant(beta);

            //Assert: The two are equal
            Assert.AreEqual(equal, true);
        }
コード例 #3
0
ファイル: DataLayer.cs プロジェクト: j-burrows/repository
        public void DataUnit_TwoDifferent_AreNotEquivilant()
        {
            //Arrange: Create two different data units
            MockDataUnit alpha = new MockDataUnit { key = 1, attrTwo = "One", attrThree = 3 };
            MockDataUnit beta = new MockDataUnit { key = 2, attrTwo = "One", attrThree = 3 };

            //Act: Compare the two via equivilance
            bool equal = alpha.Equivilant(beta);

            //Assert: The two are equal
            Assert.AreEqual(equal, false);
        }