예제 #1
0
        public void REQ_17_FinalizeOnlineBracket_WithDelieveryModeClickNCollect()
        {
            WebSession webSession = MakeWebConnectedSession();

            var availablesShops = _shopsService.GetShops();

            Assert.AreEqual(2, availablesShops.Count());

            var selectedShop = availablesShops.First(
                shop => shop.Address.City == "Balma"
                );

            webSession.SetClickNCollectDeliveryMode(selectedShop.Id);
            Assert.AreEqual(DeliveryMode.ClickCollect, webSession.SelectedDeliveryMode);
            Assert.AreEqual(DeliveryMode.ClickCollect, webSession.SelectedDeliveryMode);
            Assert.AreEqual(selectedShop.Id, webSession.GetSelectedShop().Id);
            Assert.IsFalse(webSession.CanCompleteTransaction);
            Assert.IsTrue(
                webSession.PayWtihBC(
                    "4545-5555-5555-5555",
                    "01/25",
                    "111"
                    )
                );

            Assert.IsTrue(webSession.CanCompleteTransaction);
            webSession.CompleteTransaction();
            var orders = webSession.GetSelectedShop().GetClickAndCollectOrder();

            Assert.AreEqual(1, orders.Count());
        }
예제 #2
0
        private Shop MakeClickNCollectOrderAlreadyPaid()
        {
            var webSession = new WebSession();
            var customer   = _webAuthentificationService.ConnectCustomer(
                "*****@*****.**",
                "notfunnypassword"
                );

            webSession.ConnectCustomer(customer);

            var articleBarCode = "0102030405";
            var article        = _articlesService.GetArticles(articleBarCode).First();

            webSession.AddArticle(article);
            var availablesShops = _shopInfosService.GetShops();

            Assert.AreEqual(2, availablesShops.Count());

            var selectedShop = availablesShops.First(
                shop => shop.Address.City == "Toulouse"
                );

            webSession.SetClickNCollectDeliveryMode(selectedShop.Id);

            webSession.PayWtihBC(
                "4545-5555-5555-5555",
                "01/25",
                "111"
                );
            webSession.CompleteTransaction();

            return(webSession.GetSelectedShop());
        }