public void GivenAClubMemberWithADefaultPaymentMethod(Table clientsTable)
 {
     membersManagementContextData.clubMember = new ClubMember(clientsTable.Rows[0]["MemberID"], clientsTable.Rows[0]["Name"], clientsTable.Rows[0]["FirstSurname"], clientsTable.Rows[0]["SecondSurname"]);
     string electronicIBANString = clientsTable.Rows[0]["Spanish IBAN Bank Account"].Replace(" ","").Substring(4);
     InternationalAccountBankNumberIBAN iban = new InternationalAccountBankNumberIBAN(electronicIBANString);
     BankAccount bankAccount = new BankAccount(iban);
     string debtorName = membersManagementContextData.clubMember.FullName;
     DirectDebitMandate directDebitmandate = new DirectDebitMandate(2345, DateTime.Now.Date, bankAccount, debtorName);
     PaymentMethod paymentMethod = new DirectDebitPaymentMethod(directDebitmandate, null);
     membersManagementContextData.clubMember.AddDirectDebitMandate(directDebitmandate);
     membersManagementContextData.clubMember.SetDefaultPaymentMethod(paymentMethod);
 }
 public void WhenIProcessTheIBAN()
 {
     BankAccount bankAccount;
     try
     {
         InternationalAccountBankNumberIBAN iban = new InternationalAccountBankNumberIBAN(bankAccountContextData.iban);
         bankAccount = new BankAccount(iban);
         ScenarioContext.Current.Add("Bank_Account", bankAccount);
     }
     catch
     {
         ScenarioContext.Current.Add("Bank_Account", null);
     }
 }
 public void TheBankAccountOfADirectDebitOrderCanBeChanged()
 {
     ClientAccountCodeCCC ccc = new ClientAccountCodeCCC("12345678061234567890");
     BankAccount ephemeralBankAcount = new BankAccount(ccc);
     DateTime ephemeralBankAcountActivationDate = new DateTime(2013, 11, 11);
     DirectDebitMandate directDebitMandate = new DirectDebitMandate(1, ephemeralBankAcountActivationDate, ephemeralBankAcount, "NoName");
     Assert.AreEqual(ephemeralBankAcount, directDebitMandate.BankAccount);
     InternationalAccountBankNumberIBAN iBAN = new InternationalAccountBankNumberIBAN("ES3011112222003333333333");
     BankAccount newBankAccount = new BankAccount(iBAN);
     DateTime dateOfChange = new DateTime(2013, 11, 30);
     directDebitMandate.ChangeBankAccount(newBankAccount, dateOfChange);
     Assert.AreEqual(newBankAccount, directDebitMandate.BankAccount);
     Assert.AreEqual(dateOfChange, directDebitMandate.BankAccountActivationDate);
     Assert.AreEqual(ephemeralBankAcount, directDebitMandate.BankAccountHistory[dateOfChange].BankAccount);
     Assert.AreEqual(ephemeralBankAcountActivationDate, directDebitMandate.BankAccountHistory[dateOfChange].AccountActivationDate);
     Assert.AreEqual(dateOfChange, directDebitMandate.BankAccountHistory[dateOfChange].AccountDeactivationDate);
 }