public void AnEmptyRentalRecordShouldHaveATotalAmountOfZero() { var customer = new Customer("John Smith"); var order = new Order(); var statement = new Statement(order, customer); Assert.AreEqual(statement.TotalAmount(order.Rentals), 0.00); }
public void GetTotalShouldReturnTheValueOfAllRentals() { var order = new Order(); order.Add(new Rental(new Movie("Jaws"), 7)); order.Add(new Rental(new Movie("Snakes"), 2)); var statement = new Statement(order, new Customer()); Assert.AreEqual(9, statement.GetTotalValue()); }
public void ShouldPopulatestatementModel() { var o1 = new Order(); var statement = new Statement(o1, customer); repository.Add(statement); ViewResult result = controller.Show(0); Assert.That(result.Model, Is.SameAs(statement)); }
public void ShouldShowStatementHistory() { var o1 = new Order(); var o2 = new Order(); var s1 = new Statement(o1, customer); var s2 = new Statement(o2, customer); repository.Add(s1); repository.Add(s2); ViewResult result = controller.Index(); Assert.That(result.Model, Contains.Item(s1)); Assert.That(result.Model, Contains.Item(s2)); }
public void ShouldProvideStatementsForCustomer() { var repository = new StatementRepository(); var c1 = new Customer("One"); var c2 = new Customer("Two"); var o1 = new Order(); var o2 = new Order(); var statement = new Statement(o1, c1); repository.Add(statement); repository.Add(new Statement(o2, c2)); var c1statements = repository.FindByCustomer(c1); Assert.That(c1statements.Contains(statement)); Assert.That(c1statements.Count(), Is.EqualTo(1)); }
public Statement(Order order, Customer customer) { this.Order = order; this.Customer = customer; }
public void EmptyCart() { this.order = new Order(); }