public void CanBrowseMarketAsGuestTest() { try { storeServiceSession.MakeGuest(); userShopperHarmony.ValidateCanBrowseMarket(); } catch (MarketException) { Assert.Fail(); } }
public void ViewStoreBadInputTest() { StoreShoppingService liorSession = (StoreShoppingService)market.GetStoreShoppingService(ref userService); liorSession.MakeGuest(); MarketAnswer ans = liorSession.ViewStoreInfo("'X"); Assert.AreEqual((int)StoreEnum.BadInput, ans.Status); }
public void ViewStoreStoreNotFound() { StoreShoppingService liorSession = (StoreShoppingService)market.GetStoreShoppingService(ref userService); liorSession.MakeGuest(); MarketAnswer ans = liorSession.ViewStoreInfo("notStore"); Assert.AreEqual((int)ViewStoreStatus.NoStore, ans.Status); }
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); }
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); }
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); }
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); }
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(); } }