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(); } }
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); }
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); }
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); }
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); }
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); }
public void ValidateRegisteredTest() { try { storeServiceSession.LoginShoper(user, pass); userShopperHarmony.ValidateRegistered(); } catch (MarketException) { Assert.Fail(); } }