Esempio n. 1
0
 private void AddProductsToBlahblah2()
 {
     _managerBridge2 = StoreManagementDriver.getBridge();
     _managerBridge2.GetStoreManagementService(_userBridge2.GetUserSession(), "blahblah2");
     _managerBridge2.AddNewProduct("Goodbye", 10, "nice product", 8);
     _managerBridge2.AddNewProduct("Goodbye2", 20, "nice product2", 20);
 }
Esempio n. 2
0
 private void AddProductsToBlahblah()
 {
     _managerBridge = StoreManagementDriver.getBridge();
     _managerBridge.GetStoreManagementService(_userBridge.GetUserSession(), "blahblah");
     _managerBridge.AddNewProduct("hello", 10, "nice product", 8);
     _managerBridge.AddNewProduct("hello2", 20, "nice product2", 20);
 }
Esempio n. 3
0
 private void CreateStore2AndProducts()
 {
     _storeBridge.OpenStore("BlahStore2", "BlahStreet2");
     _storeManage2 = StoreManagementDriver.getBridge();
     _storeManage2.GetStoreManagementService(_bridge1.GetUserSession(), "BlahStore2");
     _storeManage2.AddNewProduct("doritos", 30, "yammy3!", 30);
 }
Esempio n. 4
0
        public void StoreDoesntExist()
        {
            _storeManage2 = StoreManagementDriver.getBridge();
            _storeManage2.GetStoreManagementService(_userBridge.GetUserSession(), "hahaha");
            MarketAnswer res2 = _storeManage2.EditProduct("bamba", "bamba500", "102020", "nice snack");

            Assert.AreEqual((int)StoreEnum.StoreNotExists, res2.Status);
        }
Esempio n. 5
0
        public void AddDiscountFailedNoUserPermissions()
        {
            SignUp(ref _userBuyer, "Vika", "Arad", "5555", "55555555");
            _storeManagementBridge2 = StoreManagementDriver.getBridge();
            _storeManagementBridge2.GetStoreManagementService(_userBuyer.GetUserSession(), "Toy");
            MarketAnswer res = _storeManagementBridge2.AddDiscountToProduct("Ouch", Convert.ToDateTime("15/04/2018"), Convert.ToDateTime("20/04/2018"), 10, "VISIBLE", true);

            Assert.AreEqual((int)StoreEnum.NoPermission, res.Status);
        }
Esempio n. 6
0
 private void OpenStoreAndProducts()
 {
     _storeShoppingBridge = StoreShoppingDriver.getBridge();
     _storeShoppingBridge.GetStoreShoppingService(_storeOwnerUserBridge.GetUserSession());
     _storeShoppingBridge.OpenStore("Toy", "notYour");
     _storeManagementBridge = StoreManagementDriver.getBridge();
     _storeManagementBridge.GetStoreManagementService(_storeOwnerUserBridge.GetUserSession(), "Toy");
     _storeManagementBridge.AddNewProduct("Ouch", 30, "Ouchouch", 6);
 }
Esempio n. 7
0
 public void MarketBuilder()
 {
     MarketDB.Instance.InsertByForce();
     SignUp(ref _userBridge, "Pnina", "lo kef", "777777", "88888888");
     _storeBridge = StoreShoppingDriver.getBridge();
     _storeBridge.GetStoreShoppingService(_userBridge.GetUserSession());
     _storeBridge.OpenStore("lokef", "li");
     _storeManage1 = StoreManagementDriver.getBridge();
     _userBridge2  = null;
 }
Esempio n. 8
0
 private void CreateStore1AndProducts()
 {
     _storeBridge = StoreShoppingDriver.getBridge();
     _storeBridge.GetStoreShoppingService(_bridge1.GetUserSession());
     _storeBridge.OpenStore("BlahStore", "BlahStreet");
     _storeManage1 = StoreManagementDriver.getBridge();
     _storeManage1.GetStoreManagementService(_bridge1.GetUserSession(), "BlahStore");
     _storeManage1.AddNewProduct("bisli", 200, "yammy!", 5);
     _storeManage1.AddNewProduct("cheaps", 20, "yammy2!", 80);
 }
Esempio n. 9
0
 private void OpenStoreAndAddProducts()
 {
     _shoppingBridge = StoreShoppingDriver.getBridge();
     _shoppingBridge.GetStoreShoppingService(_storeOwnerBridge.GetUserSession());
     _shoppingBridge.OpenStore(storeName, "Great Place");
     _storeManagementBridge = StoreManagementDriver.getBridge();
     _storeManagementBridge.GetStoreManagementService(_storeOwnerBridge.GetUserSession(), storeName);
     _storeManagementBridge.AddNewLottery("Fanta", 12, "very nice fanta", Convert.ToDateTime("14/04/2018"), Convert.ToDateTime("28/12/2018"));
     _storeManagementBridge.AddNewLottery("Cola", 24, "very nice cola", Convert.ToDateTime("14/04/2018"), Convert.ToDateTime("28/12/2018"));
 }
Esempio n. 10
0
        public void StoreOwnerSucceededPromote()
        {
            _storeManager1.GetStoreManagementService(_bridgeSignUp.GetUserSession(), "basush");
            MarketAnswer res = _storeManager1.PromoteToStoreManager("eurovision", "StoreOwner");

            Assert.AreEqual((int)PromoteStoreStatus.Success, res.Status);
            //check if eurovision can promote someone himself - if not, he is not an owner
            SignIn("eurovision", "852963");
            _storeManager2 = StoreManagementDriver.getBridge();
            _storeManager2.GetStoreManagementService(_signInBridge.GetUserSession(), "basush");
            Assert.AreEqual((int)PromoteStoreStatus.Success, _storeManager2.PromoteToStoreManager("blah", "StoreOwner").Status);
        }
Esempio n. 11
0
 public void MarketBuilder()
 {
     MarketDB.Instance.InsertByForce();
     _ownerStoreBridge = StoreManagementDriver.getBridge();
     _userBridge       = UserDriver.getBridge();
     _userBridge.EnterSystem();
     _userBridge.SignUp("Pnina", "misholSusia", "852852", "77777777");
     _storeShopping = StoreShoppingDriver.getBridge();
     _storeShopping.GetStoreShoppingService(_userBridge.GetUserSession());
     _storeShopping.OpenStore("HistoryShop", "blah");
     _ownerStoreBridge.GetStoreManagementService(_userBridge.GetUserSession(), "HistoryShop");
 }
Esempio n. 12
0
        public void AddDiscountFailedNoStore()
        {
            CheckNoDiscountAdded();

            _storeManagementBridge2 = StoreManagementDriver.getBridge();
            _storeManagementBridge2.GetStoreManagementService(_storeOwnerUserBridge.GetUserSession(), "StoreNotExists");
            MarketAnswer res = _storeManagementBridge2.AddDiscountToProduct("Ouch", Convert.ToDateTime("15/04/2018"), Convert.ToDateTime("20/04/2018"), 10, "VISIBLE", false);

            Assert.AreEqual((int)DiscountStatus.NoStore, res.Status);

            CheckNoDiscountAdded();
        }
Esempio n. 13
0
 private void OpenStoreAndAddProducts()
 {
     _shoppingBridge = StoreShoppingDriver.getBridge();
     _shoppingBridge.GetStoreShoppingService(_storeOwnerBridge.GetUserSession());
     _shoppingBridge.OpenStore("Yalla", "Balagan");
     _storeManagementBridge = StoreManagementDriver.getBridge();
     _storeManagementBridge.GetStoreManagementService(_storeOwnerBridge.GetUserSession(), "Yalla");
     _storeManagementBridge.AddNewProduct("Tea", 10, "CherryFlavour", 6);
     _shoppingBridge.OpenStore("HAHAHA", "LOLOLO");
     _storeManagementBridge2 = StoreManagementDriver.getBridge();
     _storeManagementBridge2.GetStoreManagementService(_storeOwnerBridge.GetUserSession(), "HAHAHA");
     _storeManagementBridge2.AddNewProduct("Coffee", 10, "Black", 6);
 }
Esempio n. 14
0
 public void MarketBuilder()
 {
     MarketDB.Instance.InsertByForce();
     _storeBridge = StoreShoppingDriver.getBridge();
     SignUp("Pnina", "mishol", "7894", "12345678");
     _storeBridge.GetStoreShoppingService(_bridgeSignUp.GetUserSession());
     Assert.AreEqual((int)OpenStoreStatus.Success, _storeBridge.OpenStore("OOF", "BASA").Status);
     _storeManagementBridge = StoreManagementDriver.getBridge();
     _storeManagementBridge.GetStoreManagementService(_bridgeSignUp.GetUserSession(), "OOF");
     _storeManagementBridge.AddNewProduct("Toy", 20, "OuchOuch", 10);
     _userWatchStock   = null;
     _storeBridgeGuest = null;
 }
Esempio n. 15
0
        public void SuccessDeleteUserSoleOwner()
        {
            SignIn(adminName, adminPass);
            _adminBridge.GetAdminService(_adminSignInBridge.GetUserSession());
            _signInBridge = UserDriver.getBridge();
            _signInBridge.EnterSystem();
            Assert.AreEqual((int)RemoveUserStatus.Success, _adminBridge.RemoveUser(userSoleStoreOwner).Status);
            _managerBridge = StoreManagementDriver.getBridge();
            _managerBridge.GetStoreManagementService(_adminSignInBridge.GetUserSession(), "blah");
            var res = _managerBridge.CloseStore();

            Assert.AreEqual((int)StoreEnum.StoreNotExists, res.Status);
            Assert.AreEqual((int)SignInStatus.NoUserFound, _signInBridge.SignIn(userSoleStoreOwner, userSoleStoreOwnerPass).Status);
        }
Esempio n. 16
0
        public void MarketBuilder()
        {
            MarketDB.Instance.InsertByForce();
            SignUp(ref _userBridge, "Pnina", "lo kef", "777777", "88888888");
            _storeBridge = StoreShoppingDriver.getBridge();
            _storeBridge.GetStoreShoppingService(_userBridge.GetUserSession());
            _storeBridge.OpenStore("lokef", "li");
            _storeManage1 = StoreManagementDriver.getBridge();
            _storeManage1.GetStoreManagementService(_userBridge.GetUserSession(), "lokef");
            MarketAnswer res1 = _storeManage1.AddNewProduct("bamba", 90, "nice snack", 30);

            Assert.AreEqual((int)StoreEnum.Success, res1.Status);
            _userBridge2  = null;
            _storeManage2 = null;
        }
Esempio n. 17
0
        public void MarketBuilder()
        {
            MarketDB.Instance.InsertByForce();
            _ownerStoreBridge = StoreManagementDriver.getBridge();

            CreateUser1();
            CreateUser2();
            CreateStoreBlahblah();
            CreateStoreBlahblah2();
            AddProductsToBlahblah();
            User1AddToCart();
            User2AddToCart();
            User1MakeOrder();
            User2MakeOrder();
        }
Esempio n. 18
0
        public void MarketBuilder()
        {
            MarketDB.Instance.InsertByForce();
            SignUp(ref _bridgeSignUp, "LAMA", "ANI TZRIHA", "121112", "85296363");
            SignUp(ref _userToPromoteBridge, "eurovision", "France", "852963", "78945678");
            SignUp(ref _userToPromoteBridge2, "blah", "NotNice", "98989", "88888888");
            _storeBridge = StoreShoppingDriver.getBridge();
            _storeBridge.GetStoreShoppingService(_bridgeSignUp.GetUserSession());
            MarketAnswer res = _storeBridge.OpenStore("basush", "rezahhhhh");

            Assert.AreEqual((int)OpenStoreStatus.Success, res.Status);
            _storeManager1 = StoreManagementDriver.getBridge();
            _storeManager2 = null;
            _signInBridge  = null;
            _adminBridge   = null;
        }
Esempio n. 19
0
        private void TryPromote(string toPromote, string actions, bool success)
        {
            MarketAnswer res = _storeManager1.PromoteToStoreManager(toPromote, actions);

            if (success)
            {
                Assert.AreEqual((int)PromoteStoreStatus.Success, res.Status);
            }
            else
            {
                Assert.AreEqual((int)PromoteStoreStatus.NoAuthority, res.Status);
            }
            SignIn(toPromote, "121112");
            _storeManager2 = StoreManagementDriver.getBridge();
            _storeManager2.GetStoreManagementService(_signInBridge.GetUserSession(), "Volcano");
        }
Esempio n. 20
0
        public void MarketBuilder()
        {
            MarketDB.Instance.InsertByForce();
            SignUp(ref _bridgeSignUp, "Odin", "Valhalla", "121112", "85296363");
            SignUp(ref _userToPromoteBridge, "Thor", "Midgard", "121112", "78945678");
            SignUp(ref _userToPromoteBridge2, "Loki", "Somewhere Else", "121112", "88888888");
            _storeBridge = StoreShoppingDriver.getBridge();
            _storeBridge.GetStoreShoppingService(_bridgeSignUp.GetUserSession());
            MarketAnswer res = _storeBridge.OpenStore("Volcano", "Iceland");

            Assert.AreEqual((int)OpenStoreStatus.Success, res.Status);
            _storeManager1 = StoreManagementDriver.getBridge();
            _storeManager2 = null;
            _signInBridge  = null;
            _adminBridge   = null;
            _guestBridge   = null;
        }
Esempio n. 21
0
        public void ChangeProductsQuantityIsNegative()
        {
            _storeManage2 = StoreManagementDriver.getBridge();
            _storeManage2.GetStoreManagementService(_userBridge.GetUserSession(), "lokef");
            MarketAnswer res = _storeManage2.AddQuanitityToProduct("bambuuuu", -10);

            Assert.AreEqual((int)StoreEnum.ProductNotFound, res.Status);
            MarketAnswer stockAnswer = _storeBridge.ViewStoreStock("lokef");

            string[] actualResult   = stockAnswer.ReportList;
            string[] expectedResult = { " name: bamba base price: 90 description: nice snack Discount: {null} Purchase Way: Immediate Quantity: 30" };
            Assert.AreEqual(expectedResult.Length, actualResult.Length);
            for (int i = 0; i < actualResult.Length; i++)
            {
                Assert.AreEqual(expectedResult[i], actualResult[i]);
            }
        }
Esempio n. 22
0
        public void ChangeProductsQuantityNoUserPermissions()
        {
            SignUp(ref _userBridge2, "BASH", "lo kef2", "777777", "88888888");
            _storeManage2 = StoreManagementDriver.getBridge();
            _storeManage2.GetStoreManagementService(_userBridge2.GetUserSession(), "lokef");
            MarketAnswer res2 = _storeManage2.AddQuanitityToProduct("bamba", 30);

            Assert.AreEqual((int)StoreEnum.NoPermission, res2.Status);
            MarketAnswer stockAnswer = _storeBridge.ViewStoreStock("lokef");

            string[] actualResult   = stockAnswer.ReportList;
            string[] expectedResult = { " name: bamba base price: 90 description: nice snack Discount: {null} Purchase Way: Immediate Quantity: 30" };
            Assert.AreEqual(expectedResult.Length, actualResult.Length);
            for (int i = 0; i < actualResult.Length; i++)
            {
                Assert.AreEqual(expectedResult[i], actualResult[i]);
            }
        }
Esempio n. 23
0
        public void NoSuchStore()
        {
            _storeManage2 = StoreManagementDriver.getBridge();
            _storeManage2.GetStoreManagementService(_userBridge.GetUserSession(), "hahaha");
            MarketAnswer res2 = _storeManage2.RemoveProduct("bamba");

            Assert.AreEqual((int)StoreEnum.StoreNotExists, res2.Status);
            MarketAnswer stockAnswer = _storeBridge.ViewStoreStock("lokef");

            string[] actualResult = stockAnswer.ReportList;
            //didn't succeed in removing the product, there is still one product
            string[] expectedResult = { " name: bamba base price: 90 description: nice snack Discount: {null} Purchase Way: Immediate Quantity: 30" };
            Assert.AreEqual(expectedResult.Length, actualResult.Length);
            for (int i = 0; i < actualResult.Length; i++)
            {
                Assert.AreEqual(expectedResult[i], actualResult[i]);
            }
        }