public void StoreDidntCloseUponUserRemovalTest() { ToSignIn(adminName, adminPass); adminServiceSession = (SystemAdminService)marketSession.GetSystemAdminService(userServiceSession); Assert.AreEqual((int)RemoveUserStatus.Success, adminServiceSession.RemoveUser(notSoleOwnerName).Status); storeShoppingService = marketSession.GetStoreShoppingService(ref userServiceSession); Assert.AreEqual((int)StoreEnum.Success, storeShoppingService.AddProductToCart("X", "BOX", 3).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 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 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 GetHistoryAfterOpeningStoreTest() { userService.SignIn("Arik1", "123"); var shoppingSession = marketSession.GetStoreShoppingService(ref userService); var answer = shoppingSession.OpenStore("HistoryShop", "blah"); Assert.AreEqual((int)StoreEnum.Success, answer.Status); var storeManagementSession = marketSession.GetStoreManagementService(userService, "HistoryShop"); Assert.AreEqual((int)StoreEnum.Success, answer.Status); answer = storeManagementSession.PromoteToStoreManager("Big Smoke", "ManageProducts,DeclareDiscountPolicy"); Assert.AreEqual((int)StoreEnum.Success, answer.Status); answer = storeManagementSession.ViewPromotionHistory(); Assert.AreEqual((int)StoreEnum.Success, answer.Status); var expected = new[] { "Store: HistoryShop Promoter: Arik1 Promoted: Arik1 Permissions: StoreOwner Date: " + DateTime.Now.ToString("dd/MM/yyyy") + " Description: HistoryShop has been opened", "Store: HistoryShop Promoter: Arik1 Promoted: Big Smoke " + "Permissions: ManageProducts,DeclareDiscountPolicy Date: " + DateTime.Now.ToString("dd/MM/yyyy") + " Description: Regular promotion" }; ComparePromotionHistory(expected, answer.ReportList); }
public void BuildInitialize() { MarketDB.Instance.InsertByForce(); market = MarketYard.Instance; userService = market.GetUserService(); storeService = market.GetStoreShoppingService(ref userService); }
public void MarketBuilder() { MarketDB.Instance.InsertByForce(); marketSession = MarketYard.Instance; userServiceSession = (UserService)marketSession.GetUserService(); userShopperHarmony = new UserShopperHarmony(ref userServiceSession); storeServiceSession = (StoreShoppingService)marketSession.GetStoreShoppingService(ref userServiceSession); }
public void BuildInitialize() { MarketDB.Instance.InsertByForce(); market = MarketYard.Instance; userService = market.GetUserService(); userService.EnterSystem(); storeService = market.GetStoreShoppingService(ref userService); p1 = " name: BOX base price: 100 description: this is a plastic box Discount: {type is: hidden} Purchase Way: Immediate Quantity: 5 Store: X"; p2 = " name: Fraid Egg base price: 10 description: yami Discount: {none} Purchase Way: Immediate Quantity: 10 Store: T"; }
public void MarketBuilder() { MarketDB.Instance.InsertByForce(); marketSession = MarketYard.Instance; userServiceSession = (UserService)marketSession.GetUserService(); userServiceSession2 = (UserService)marketSession.GetUserService(); userServiceSession3 = (UserService)marketSession.GetUserService(); userServiceSession2.EnterSystem(); userServiceSession3.EnterSystem(); userServiceSession2.SignIn(sysadmin, pass); sysadminSession = marketSession.GetSystemAdminService(userServiceSession2); userServiceSession.EnterSystem(); orderServiceSession = (OrderService)marketSession.GetOrderService(ref userServiceSession); storeServiceSession = (StoreShoppingService)marketSession.GetStoreShoppingService(ref userServiceSession); }
public void GetStoreShoppingService(IUserService userService) { _storeShoppingService = _market.GetStoreShoppingService(ref userService); }