public void ADirectDebitMandateCanBeDeactivated()
 {
     ClientAccountCodeCCC ccc = new ClientAccountCodeCCC("12345678061234567890");
     BankAccount bankAccount = new BankAccount(ccc);
     DirectDebitMandate directDebitMandate = new DirectDebitMandate(1, DateTime.Now.Date, bankAccount, "NoName");
     Assert.AreEqual(DirectDebitMandate.DirectDebitmandateStatus.Active, directDebitMandate.Status);
     directDebitMandate.DeactivateMandate();
     Assert.AreEqual(DirectDebitMandate.DirectDebitmandateStatus.Inactive, directDebitMandate.Status);
 }
 public void ABankAccountHistoricalDataIsCorrectlyCreated()
 {
     ClientAccountCodeCCC ccc = new ClientAccountCodeCCC("12345678061234567890");
     BankAccount bankAccount = new BankAccount(ccc);
     DateTime activationDate = new DateTime(2013, 11, 11);
     DateTime deactivationDate = new DateTime(2013, 11, 30);
     BankAccountHistoricalData ephemeralBankAcount = new BankAccountHistoricalData(bankAccount, activationDate, deactivationDate);
     Assert.AreEqual(bankAccount, ephemeralBankAcount.BankAccount);
     Assert.AreEqual(activationDate, ephemeralBankAcount.AccountActivationDate);
     Assert.AreEqual(deactivationDate, ephemeralBankAcount.AccountDeactivationDate);
 }
 public void WhenIProcessTheCCC()
 {
     BankAccount bankAccount;
     try
     {
         ClientAccountCodeCCC ccc = new ClientAccountCodeCCC(bankAccountContextData.ccc);
         bankAccount = new BankAccount(ccc);
         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);
 }
 public void ProvidingTheLastDirectDebitReferenceNumberWas100TheNextAssignedMustBe101()
 {
     billDataManager.DirectDebitSequenceNumber = 100;
     ClientAccountCodeCCC ccc = new ClientAccountCodeCCC("12345678061234567890");
     BankAccount bankAccount = new BankAccount(ccc);
     DirectDebitMandate directDebitMandate = new DirectDebitMandate(DateTime.Now.Date, bankAccount, "NoName");
     Assert.AreEqual((uint)101, billDataManager.DirectDebitSequenceNumber);
 }