Example #1
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);
        }
Example #2
0
 public void OpenStoreAsGuestTest()
 {
     try
     {
         storeServiceSession.MakeGuest();
         storeServiceSession.OpenStore("Newstore1", "Nowhere");
         Assert.IsFalse(((UserService)userServiceSession).MarketUser.HasStorePolicies());
     }
     catch (MarketException)
     {
         Assert.Fail();
     }
 }
Example #3
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);
        }
Example #4
0
        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);
        }
Example #5
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);
        }