public void RegUserBuyItem()
 {
     try
     {
         storeServiceSession.LoginShoper(user, pass);
         storeServiceSession.AddProductToCart(store, product, 3);
         orderServiceSession.LoginBuyer(user, pass);
         orderServiceSession.BuyItemFromImmediate(product, store, 3, 11, null);
         Assert.AreEqual(2, sysadminSession.ViewPurchaseHistoryByStore(store).ReportList.Length);
         string actual = sysadminSession.ViewPurchaseHistoryByStore(store).ReportList[1];
         Assert.AreEqual(PurchaseString(user), actual);
     }
     catch (MarketException)
     {
         Assert.Fail();
     }
 }
Beispiel #2
0
        public void OpenStoreBadInputFail()
        {
            StoreShoppingService liorSession = (StoreShoppingService)market.GetStoreShoppingService(ref userService);

            liorSession.LoginShoper("Arik3", "123");
            MarketAnswer ans = liorSession.OpenStore("newSto'reName", "adress");

            Assert.AreEqual((int)OpenStoreStatus.BadInput, ans.Status);
        }
Beispiel #3
0
        public void ViewStoreStockBadInputFail()
        {
            StoreShoppingService liorSession = (StoreShoppingService)market.GetStoreShoppingService(ref userService);

            liorSession.LoginShoper("Arik3", "123");
            MarketAnswer ans = liorSession.ViewStoreStock("X'");

            Assert.AreEqual((int)StoreEnum.BadInput, ans.Status);
        }
Beispiel #4
0
        public void ViewStoreStockWhenStoreNotExists()
        {
            StoreShoppingService liorSession = (StoreShoppingService)market.GetStoreShoppingService(ref userService);

            liorSession.LoginShoper("Arik3", "123");
            MarketAnswer ans = liorSession.ViewStoreStock("STORE_NOT_EXISTS");

            Assert.AreEqual((int)StoreEnum.StoreNotExists, ans.Status);
        }
Beispiel #5
0
        public void OpenStoreInterfaceLevelSameName()
        {
            StoreShoppingService liorSession = (StoreShoppingService)market.GetStoreShoppingService(ref userService);

            liorSession.LoginShoper("Arik3", "123");
            MarketAnswer ans = liorSession.OpenStore("newStoreName", "adress");

            toDeleteStore = handler.GetStorebyName("newStoreName");
            ans           = liorSession.OpenStore("newStoreName", "adress");
            Assert.AreEqual((int)OpenStoreStatus.AlreadyExist, ans.Status);
        }
Beispiel #6
0
        public void OpenStoreInterfaceLevelPass()
        {
            StoreShoppingService liorSession = (StoreShoppingService)market.GetStoreShoppingService(ref userService);

            liorSession.LoginShoper("Arik3", "123");
            Store find = handler.GetStorebyName("newStoreName");

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

            find = handler.GetStorebyName("newStoreName");
            Assert.IsNotNull(find);
            toDeleteStore = handler.GetStorebyName("newStoreName");
            Assert.IsNotNull(toDeleteStore);
            Assert.AreEqual((int)OpenStoreStatus.Success, ans.Status);
        }
Beispiel #7
0
 public void ValidateRegisteredTest()
 {
     try
     {
         storeServiceSession.LoginShoper(user, pass);
         userShopperHarmony.ValidateRegistered();
     }
     catch (MarketException)
     {
         Assert.Fail();
     }
 }