Exemplo n.º 1
0
 public void AddQuantityTooManyItemsTest()
 {
     var testEventPublisher = new TestEventPublisher();
     var shoppingCart = new ShoppingCart(testEventPublisher, 13, 10);
     shoppingCart.AddQuantity(15);
     Assert.IsTrue(testEventPublisher.SuccessEvents.Count == 0);
     Assert.IsTrue(testEventPublisher.FailedEvents.Count == 1);
     Assert.IsTrue(testEventPublisher.FailedEvents[0].ProductId == 13);
 }
Exemplo n.º 2
0
 public void AddQuantityNegativeValueTest()
 {
     var testEventPublisher = new TestEventPublisher();
     var shoppingCart = new ShoppingCart(testEventPublisher, 13, 4);
     shoppingCart.AddQuantity(-9);
     Assert.IsTrue(testEventPublisher.SuccessEvents.Count == 0);
     Assert.IsTrue(testEventPublisher.FailedEvents.Count == 1);
     Assert.IsTrue(testEventPublisher.FailedEvents[0].ProductId == 13);
 }