public void Tests(string input, string expectedResult) { var account = AccountNumberReader.GetAccountNumbersFrom(input).First(); if (account.HasUnrecognisedDigits()) { var alternatives = account.GetAlternativeNumbersForUnrecognised(); if (alternatives.Any()) { account.Number = alternatives[0].Number; //override invalid account number alternatives.RemoveAt(0); foreach (var alt in alternatives) { account.AlternativeNumbers.AddRange(alt.GetAlternativeNumbers()); } } } else { account.AlternativeNumbers.AddRange(account.GetAlternativeNumbers()); } Assert.AreEqual(expectedResult, account.ToString()); }
public void Tests(string input, string expectedResult) { var accounts = AccountNumberReader.GetAccountNumbersFrom(input); Assert.AreEqual(1, accounts.Count()); var account = accounts.First(); Assert.AreEqual(expectedResult, account.ToString()); }