public void CustomerAccountStillActiveSpecification_Should_Not_Be_Satisfied_By_An_Active_Customer_When_Used_With_A_NotSpecification() { CustomerAccount customerActive = new CustomerAccount() { AccountActive = true }; ISpecification <CustomerAccount> specification = new CustomerAccountStillActiveSpecification(); Assert.IsFalse(specification.Not().IsSatisfiedBy(customerActive)); }
public void CustomerAccountStillActiveSpecification_Should_Be_Satisfied_By_An_Active_Customer() { CustomerAccount customerActive = new CustomerAccount() { AccountActive = true }; CustomerAccountStillActiveSpecification specification = new CustomerAccountStillActiveSpecification(); Assert.IsTrue(specification.IsSatisfiedBy(customerActive)); }
public void CustomerAccountStillActiveSpecification_Should_Not_Be_Satisfied_By_A_Customer_Who_Is_Not_Active() { CustomerAccount customerNotActive = new CustomerAccount() { AccountActive = false }; CustomerAccountStillActiveSpecification specification = new CustomerAccountStillActiveSpecification(); Assert.IsFalse(specification.IsSatisfiedBy(customerNotActive)); }
public void A_Composite_Of_Two_Satisfied_Specifications_Should_Not_Be_Satisfied_When_Used_With_A_NotSpecification() { CustomerAccount customerActive = new CustomerAccount() { AccountActive = true, LateFees = 100 }; ISpecification <CustomerAccount> specificationActive = new CustomerAccountStillActiveSpecification(); ISpecification <CustomerAccount> specificationLateFees = new CustomerAccountHasLateFeesSpecification(); Assert.IsFalse(specificationActive.And(specificationLateFees).Not().IsSatisfiedBy(customerActive)); }