Beispiel #1
0
 public void Test01CanNotCheckoutEmtpyCart()
 {
     try
     {
         cashier.PriceFor(cart, objectProvider.ACatalog());
         Assert.Fail();
     }
     catch (ArgumentException e)
     {
         Assert.AreEqual("The cart cannot be empty for checkout", e.Message);
     }
 }
        public void Test06CanCheckoutACartWithOneBookWithASpecificCatalog()
        {
            IYourBooksApplication application = objectProvider.YourBooksApplication();

            application.RegisterClient("marcos", "123");
            Client aClient = application.Login("marcos", "123");
            Guid   aCartId = application.CreateCart(aClient.Id, aClient.Password);

            application.AddAQuantityOfAnItem(1, objectProvider.ABook(), aCartId);

            Guid transactionId = application.CheckoutCart(aCartId, objectProvider.AValidCreditCard(), objectProvider.ACatalog());

            Sale sale = application.GetSale(transactionId);

            Assert.IsTrue(application.IsSaleRegistered(sale));
        }