示例#1
0
 public void CanBrowseMarketAsGuestTest()
 {
     try
     {
         storeServiceSession.MakeGuest();
         userShopperHarmony.ValidateCanBrowseMarket();
     }
     catch (MarketException)
     {
         Assert.Fail();
     }
 }
示例#2
0
        public void ViewStoreBadInputTest()
        {
            StoreShoppingService liorSession = (StoreShoppingService)market.GetStoreShoppingService(ref userService);

            liorSession.MakeGuest();
            MarketAnswer ans = liorSession.ViewStoreInfo("'X");

            Assert.AreEqual((int)StoreEnum.BadInput, ans.Status);
        }
示例#3
0
        public void ViewStoreStoreNotFound()
        {
            StoreShoppingService liorSession = (StoreShoppingService)market.GetStoreShoppingService(ref userService);

            liorSession.MakeGuest();
            MarketAnswer ans = liorSession.ViewStoreInfo("notStore");

            Assert.AreEqual((int)ViewStoreStatus.NoStore, ans.Status);
        }
示例#4
0
        public void AddToCartSuccess()
        {
            StoreShoppingService liorSession = (StoreShoppingService)market.GetStoreShoppingService(ref userService);

            liorSession.MakeGuest();
            Store        find = handler.GetStorebyName("X");
            MarketAnswer ans  = liorSession.AddProductToCart("X", "BOX", 1);

            Assert.AreEqual((int)StoreEnum.Success, ans.Status);
        }
示例#5
0
        public void AddToCartWhenQuantityisTooBig()
        {
            StoreShoppingService liorSession = (StoreShoppingService)market.GetStoreShoppingService(ref userService);

            liorSession.MakeGuest();
            Store        find = handler.GetStorebyName("X");
            MarketAnswer ans  = liorSession.AddProductToCart("X", "BOX", 999999);

            Assert.AreEqual((int)StoreEnum.QuantityIsTooBig, ans.Status);
        }
示例#6
0
        public void AddToCartWhenProductIsNotExistsInStore()
        {
            StoreShoppingService liorSession = (StoreShoppingService)market.GetStoreShoppingService(ref userService);

            liorSession.MakeGuest();
            Store        find = handler.GetStorebyName("X");
            MarketAnswer ans  = liorSession.AddProductToCart("X", "BOBO", 6);

            Assert.AreEqual((int)StoreEnum.ProductNotFound, ans.Status);
        }
示例#7
0
        public void OpenStoreInterfaceLevelFail()
        {
            StoreShoppingService liorSession = (StoreShoppingService)market.GetStoreShoppingService(ref userService);

            liorSession.MakeGuest();
            Store find = handler.GetStorebyName("newStoreName");

            Assert.IsNull(find);
            MarketAnswer ans = liorSession.OpenStore("newStoreName", "adress");

            Assert.AreEqual((int)OpenStoreStatus.InvalidUser, ans.Status);
        }
示例#8
0
        public void AddToCartWhenStoreNotExists()
        {
            StoreShoppingService liorSession = (StoreShoppingService)market.GetStoreShoppingService(ref userService);

            liorSession.MakeGuest();
            Store find = handler.GetStorebyName("newStoreName");

            Assert.IsNull(find);
            MarketAnswer ans = liorSession.AddProductToCart("newStoreName", "ppp", 6);

            Assert.AreEqual((int)StoreEnum.StoreNotExists, ans.Status);
        }
 public void GuestBuyItem()
 {
     try
     {
         storeServiceSession.MakeGuest();
         storeServiceSession.AddProductToCart(store, product, 3);
         orderServiceSession.GiveDetails("Someone", "Somewhere", "12345689");
         orderServiceSession.BuyItemFromImmediate(product, store, 3, 11, null);
         Assert.AreEqual(2, sysadminSession.ViewPurchaseHistoryByStore(store).ReportList.Length);
         string actual = sysadminSession.ViewPurchaseHistoryByStore(store).ReportList[0];
         Assert.AreEqual(PurchaseString("Someone"), actual);
     }
     catch (MarketException)
     {
         Assert.Fail();
     }
 }