public void AnInvoiceIsCorrectlyCancelled() { clubMemberDataManager.MemberIDSequenceNumber = 5; ClubMember clubMember = new ClubMember("Francisco", "Gomez-Caldito", "Viseas"); InvoiceCustomerData invoiceCustomerData = new InvoiceCustomerData(clubMember); Invoice invoice = new Invoice( new InvoiceCustomerData(clubMember), new List<Transaction>() { new Transaction("Kajak Rent", 1, 50, new Tax("No Tax", 0), 0) }, DateTime.Now); InvoicesManager invoicesManager = new InvoicesManager(); invoicesManager.AddInvoiceToClubMember(invoice, clubMember); invoicesManager.CancelInvoice(invoice, clubMember); Assert.AreEqual(Invoice.InvoicePaymentState.Cancelled, invoice.InvoiceState); }
public void WhenCancellingAnInvoiceAnAmendingInvoiceIsCreatedAndAssignedToTheDebtor() { clubMemberDataManager.MemberIDSequenceNumber = 5; billDataManager.InvoiceSequenceNumber = 5; ClubMember clubMember = new ClubMember("Francisco", "Gomez-Caldito", "Viseas"); InvoiceCustomerData invoiceCustomerData = new InvoiceCustomerData(clubMember); Invoice invoice = new Invoice( new InvoiceCustomerData(clubMember), new List<Transaction>() { new Transaction("Kajak Rent", 1, 50, new Tax("No Tax", 0), 0) }, DateTime.Now); InvoicesManager invoicesManager = new InvoicesManager(); invoicesManager.AddInvoiceToClubMember(invoice, clubMember); Assert.AreEqual(0, clubMember.AmendingInvoicesList.Count); invoicesManager.CancelInvoice(invoice, clubMember); Assert.IsNotNull(clubMember.AmendingInvoicesList["AMN2013000005"]); }