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); }
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); }
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); }