public async Task <DateTime?> CalculateTransfer(string sourceIban = null, string targetIban = null) { DateTime?result = null; if (!string.IsNullOrEmpty(sourceIban)) { var sourceId = elixirLogic.GetBankIdFromIBAN(sourceIban); Source = Banks.Where(b => b.Identifier == sourceId).FirstOrDefault(); } if (!string.IsNullOrEmpty(targetIban)) { var targetId = elixirLogic.GetBankIdFromIBAN(targetIban); Target = Banks.Where(b => b.Identifier == targetId).FirstOrDefault(); } try { result = await elixirLogic.GetTransferTime(SendTime, Source, Target); } catch (ArgumentException ex) { OnPropertyChanged("BankInvalid"); } return(result); }
public void GetIdentifierFromIban_ShouldGet() { var result = elixirLogic.GetBankIdFromIBAN("98124013691138220834089189"); Assert.AreEqual(result, "124"); }