예제 #1
0
        public void Check_ValidLookingAccountDetails_ReturnsSuccessOrFailureCorrectly(string sortCode, string accountNo, bool expectedSuccess, ModulusCheckingMethod method)
        {
            // Arrange
            var accountDetails        = new BankDetails(sortCode, accountNo);
            var modulusWeightingTable = ModulusTestHelper.CreateStandardWeightingTable(method);
            var accountDetailsChecker = new AccountDetailsChecker(modulusWeightingTable);

            // Act
            var accountCheckResult = accountDetailsChecker.Check(accountDetails);

            // Assert
            Assert.AreEqual(expectedSuccess, accountCheckResult.Success);
        }
        public void IsValid_ValidAccountDetails_ReturnsTrue(string sortCode, string accountNo, ModulusCheckingMethod checkingMethod)
        {
            // Arrange
            var bankDetails = new BankDetails(sortCode, accountNo);
            var modulusParametersFactory = new ModulusParametersFactory(ModulusTestHelper.CreateStandardWeightingTable(checkingMethod));
            var modulusParameters        = modulusParametersFactory.CreateModulusParameters(bankDetails);
            var standardModulusCheck     = new StandardModulusCheck(modulusParameters);

            // Act
            var result = standardModulusCheck.IsValid(bankDetails);

            // Assert
            Assert.AreEqual(true, result);
        }