コード例 #1
0
            public void Equals_ReturnsTrue_WhenTheReferencesAreEqual()
            {
                // Arrange
                IContext contextL = Substitute.For <IContext>();
                AbstractRepositoryFactory <IContext> abstractRepositoryFactoryL = Substitute.ForPartsOf <AbstractRepositoryFactory <IContext> >(contextL);
                AbstractRepositoryFactory <IContext> abstractRepositoryFactoryR = abstractRepositoryFactoryL;

                bool actual;

                // Act
                actual = abstractRepositoryFactoryL.Equals(abstractRepositoryFactoryR);

                // Assert
                Assert.True(actual);
            }
コード例 #2
0
            public void Equals_ReturnsFalse_WhenOtherIsNull()
            {
                // Arrange
                IContext contextL = Substitute.For <IContext>();
                AbstractRepositoryFactory <IContext> abstractRepositoryFactoryL = Substitute.ForPartsOf <AbstractRepositoryFactory <IContext> >(contextL);
                AbstractRepositoryFactory <IContext> abstractRepositoryFactoryR = default;

                bool actual;

                // Act
                actual = abstractRepositoryFactoryL.Equals(abstractRepositoryFactoryR);

                // Assert
                Assert.False(actual);
            }
コード例 #3
0
            public void Equals_ReturnsFalse_WhenTheContextsAndReferencesAreDifferent()
            {
                // Arrange
                IContext contextL = Substitute.For <IContext>();
                AbstractRepositoryFactory <IContext> abstractRepositoryFactoryL = Substitute.ForPartsOf <AbstractRepositoryFactory <IContext> >(contextL);

                IContext contextR = Substitute.For <IContext>();
                AbstractRepositoryFactory <IContext> abstractRepositoryFactoryR = Substitute.ForPartsOf <AbstractRepositoryFactory <IContext> >(contextR);

                bool actual;

                // Act
                actual = abstractRepositoryFactoryL.Equals(abstractRepositoryFactoryR);

                // Assert
                Assert.False(actual);
            }