コード例 #1
0
 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();
     }
 }
コード例 #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);
        }
コード例 #3
0
ファイル: ViewStoreStockTests.cs プロジェクト: maorRoz/Sadna
        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);
        }
コード例 #4
0
ファイル: ViewStoreStockTests.cs プロジェクト: maorRoz/Sadna
        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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #7
0
 public void ValidateRegisteredTest()
 {
     try
     {
         storeServiceSession.LoginShoper(user, pass);
         userShopperHarmony.ValidateRegistered();
     }
     catch (MarketException)
     {
         Assert.Fail();
     }
 }