public void CanExplainWhyItDoesNotCallSecondCheck() { var bankAccountDetails = BankDetailsTestMother.BankDetailsWithException(3); var modulusCheckOutcome = _isSecondCheckRequiredGate.Process(bankAccountDetails); Assert.AreEqual("first weight mapping exception does not require second check", modulusCheckOutcome.Explanation); }
public void DoesNotCallSecondCheckIfExceptionDoesNotRequireIt(int exception) { var bankAccountDetails = BankDetailsTestMother.BankDetailsWithException(exception); _isSecondCheckRequiredGate.Process(bankAccountDetails); _nextStep.Verify(ns => ns.Process(bankAccountDetails), Times.Never); }
public void ExceptionRequiresSecondCheckItCallsNext(int exception) { var bankAccountDetails = BankDetailsTestMother.BankDetailsWithException(exception); _isSecondCheckRequiredGate.Process(bankAccountDetails); _nextStep.Verify(ns => ns.Process(bankAccountDetails), Times.Once); }
public void ItExplainsThatItCallsTheExceptionCalculatorWhenTheFirstTestFails() { var details = BankDetailsTestMother.BankDetailsWithException(14); details.FirstResult = false; var modulusCheckOutcome = _exceptionFourteenGate.Process(details); Assert.AreEqual("StandardModulusExceptionFourteenCalculator", modulusCheckOutcome.Explanation); }
public void ItExplainsThatItReturnsFirstResultWhenThatPasses() { var details = BankDetailsTestMother.BankDetailsWithException(14); details.FirstResult = true; var modulusCheckOutcome = _exceptionFourteenGate.Process(details); Assert.AreEqual("Coutts Account with passing first check", modulusCheckOutcome.Explanation); }
public void CanCallNextStepWhenAccountDoesNotQualifyToSkip(int exception, bool firstCheck) { var details = BankDetailsTestMother.BankDetailsWithException(exception); details.FirstResult = firstCheck; _isExceptionTwoAndFirstCheckPassedGate.Process(details); _nextStep.Verify(ns => ns.Process(details), Times.Once); }
public void CanExplainSkippingSecondCheck() { var details = BankDetailsTestMother.BankDetailsWithException(2); details.FirstResult = true; var modulusCheckOutcome = _isExceptionTwoAndFirstCheckPassedGate.Process(details); Assert.AreEqual("IsExceptionTwoAndFirstCheckPassed", modulusCheckOutcome.Explanation); }
public void CanSkipSecondCheckForExceptionTwoWithPassedFirstCheck() { var details = BankDetailsTestMother.BankDetailsWithException(2); details.FirstResult = true; _isExceptionTwoAndFirstCheckPassedGate.Process(details); _nextStep.Verify(ns => ns.Process(details), Times.Never); }
public void ItCallsTheExceptionCalculatorWhenTheFirstTestFails() { var details = BankDetailsTestMother.BankDetailsWithException(14); details.FirstResult = false; _exceptionFourteenGate.Process(details); _nextStep.Verify(ns => ns.Process(details), Times.Never); _mockCalc.Verify(mc => mc.Process(details), Times.Once); }
public void ItReturnsFirstResultWhenThatPasses() { var details = BankDetailsTestMother.BankDetailsWithException(14); details.FirstResult = true; _exceptionFourteenGate.Process(details); _nextStep.Verify(ns => ns.Process(details), Times.Never); _mockCalc.Verify(mc => mc.Process(details), Times.Never); }
public void ItCallsTheNextStep() { var mockCalc = new Mock <StandardModulusExceptionFourteenCalculator>(); var nextStep = new Mock <IProcessAStep>(); var gate = new ExceptionFourteenGate(mockCalc.Object, nextStep.Object); var details = BankDetailsTestMother.BankDetailsWithException(0); gate.Process(details); nextStep.Verify(ns => ns.Process(details), Times.Once); mockCalc.Verify(mc => mc.Process(details), Times.Never); }