Пример #1
0
        public void DidntEnterSystemChangeQuantity()
        {
            _bridgeGuest2 = UserDriver.getBridge();
            MarketAnswer res = _bridgeGuest2.EditCartItem("BlahStore", "bisli", 1, 200);

            Assert.AreEqual((int)EditCartItemStatus.DidntEnterSystem, res.Status);
        }
Пример #2
0
        public void DidntEnterSystemRemoveItem()
        {
            _bridgeGuest2 = UserDriver.getBridge();
            MarketAnswer res = _bridgeGuest2.RemoveFromCart("BlahStore2", "doritos", 30);

            Assert.AreEqual((int)RemoveFromCartStatus.DidntEnterSystem, res.Status);
        }
Пример #3
0
 private void UserWatchStockInitialize()
 {
     _userWatchStock = UserDriver.getBridge();
     _userWatchStock.EnterSystem();
     _storeBridgeGuest = StoreShoppingDriver.getBridge();
     _storeBridgeGuest.GetStoreShoppingService(_userWatchStock.GetUserSession());
 }
Пример #4
0
 public void LotteryFailGuest()
 {
     _buyerGuestBridge = UserDriver.getBridge();
     _buyerGuestBridge.EnterSystem();
     _orderBridge1 = OrderDriver.getBridge();
     _orderBridge1.GetOrderService(_buyerGuestBridge.GetUserSession());
     Assert.AreEqual((int)OrderStatus.InvalidUser, _orderBridge1.BuyLotteryTicket("Fanta", storeName, 1, 4).Status);
 }
Пример #5
0
 private void MakeRegisteredShopper3()
 {
     _buyerRegisteredUserBridge3 = UserDriver.getBridge();
     _buyerRegisteredUserBridge3.EnterSystem();
     _buyerRegisteredUserBridge3.SignUp("Shalom3", "Bye3", "555", "55555555");
     _orderBridge3 = OrderDriver.getBridge();
     _orderBridge3.GetOrderService(_buyerRegisteredUserBridge3.GetUserSession());
 }
Пример #6
0
 public void RegistrationWithATakenName()
 {
     _bridge.EnterSystem();
     _bridge.SignUp("Pnina", "miahol susia 12", "123456", "12345678");
     _bridge2 = UserDriver.getBridge();
     _bridge2.EnterSystem();
     Assert.AreEqual((int)SignUpStatus.TakenName, _bridge2.SignUp("Pnina", "miahol susia 12", "123456", "12345678").Status);
 }
Пример #7
0
 public void MarketBuilder()
 {
     MarketDB.Instance.InsertByForce();
     SignIn();
     CreateStore1AndProducts();
     CreateStore2AndProducts();
     _bridgeSignUp = UserDriver.getBridge();
     _storeBridge3 = null;
 }
Пример #8
0
 private void AddProductsToCartGuest()
 {
     _buyerGuestBridge = UserDriver.getBridge();
     _buyerGuestBridge.EnterSystem();
     _shoppingBridge2 = StoreShoppingDriver.getBridge();
     _shoppingBridge2.GetStoreShoppingService(_buyerGuestBridge.GetUserSession());
     _shoppingBridge2.AddProductToCart("Yalla", "Tea", 4);
     _shoppingBridge2.AddProductToCart("HAHAHA", "Coffee", 3);
 }
Пример #9
0
 public void SuccessDeleteUserNotSoleOwner()
 {
     SignIn(adminName, adminPass);
     _adminBridge.GetAdminService(_adminSignInBridge.GetUserSession());
     Assert.AreEqual((int)RemoveUserStatus.Success, _adminBridge.RemoveUser(userNotSoleStoreOwner).Status);
     _signInBridge = UserDriver.getBridge();
     _signInBridge.EnterSystem();
     Assert.AreEqual((int)SignInStatus.NoUserFound, _signInBridge.SignIn(userNotSoleStoreOwner, userNotSoleStoreOwnerPass).Status);
 }
Пример #10
0
        public void InvalidUserDidntEnterSystem()
        {
            _userWatchStore   = UserDriver.getBridge();
            _storeBridgeGuest = StoreShoppingDriver.getBridge();
            _storeBridgeGuest.GetStoreShoppingService(_userWatchStore.GetUserSession());
            MarketAnswer storeDetails = _storeBridgeGuest.ViewStoreInfo("OOF");

            Assert.AreEqual((int)ViewStoreStatus.InvalidUser, storeDetails.Status);
            Assert.AreEqual(null, storeDetails.ReportList);
        }
Пример #11
0
 private void AddProductsToCartRegisteredUser()
 {
     _buyerRegisteredUserBridge = UserDriver.getBridge();
     _buyerRegisteredUserBridge.EnterSystem();
     _buyerRegisteredUserBridge.SignUp("Shalom", "Bye", "555", "55555555");
     _shoppingBridge2 = StoreShoppingDriver.getBridge();
     _shoppingBridge2.GetStoreShoppingService(_buyerRegisteredUserBridge.GetUserSession());
     _shoppingBridge2.AddProductToCart("Yalla", "Tea", 4);
     _shoppingBridge2.AddProductToCart("HAHAHA", "Coffee", 3);
 }
Пример #12
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");
 }
Пример #13
0
        public void GuestViewStore()
        {
            _userWatchStore = UserDriver.getBridge();
            _userWatchStore.EnterSystem();
            _storeBridgeGuest = StoreShoppingDriver.getBridge();
            _storeBridgeGuest.GetStoreShoppingService(_userWatchStore.GetUserSession());
            MarketAnswer storeDetails = _storeBridgeGuest.ViewStoreInfo("OOF");

            Assert.AreEqual((int)ViewStoreStatus.Success, storeDetails.Status);
            string expectedAnswer = "_storeName: OOF StoreAddress: BASA";
            string receivedAnswer = "_storeName: " + storeDetails.ReportList[0] + " StoreAddress: " + storeDetails.ReportList[1];

            Assert.AreEqual(expectedAnswer, receivedAnswer);
        }
Пример #14
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);
        }
Пример #15
0
        public void AdminSystemSucceededPromote()
        {
            _adminBridge = UserDriver.getBridge();
            _adminBridge.EnterSystem();
            _adminBridge.SignIn(adminName, adminPass);
            _storeManager1.GetStoreManagementService(_adminBridge.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);
        }
Пример #16
0
 public void MarketBuilder()
 {
     MarketDB.Instance.InsertByForce();
     _bridge      = UserDriver.getBridge();
     _bridge1     = UserDriver.getBridge();
     _bridgeGuest = UserDriver.getBridge();
     _bridgeGuest.EnterSystem();
     _bridge1.EnterSystem();
     _bridge1.SignUp("vika", "arad", "6666", "11111111");
     CreateStore1AndProducts();
     CreateStore2AndProducts();
     User1AddToCart();
     GuestAddToCart();
     _storeGuestBridge = null;
 }
Пример #17
0
        public void MarketBuilder()
        {
            MarketDB.Instance.InsertByForce();
            SignUp("Pnina", "mishol", "666", "66666666");
            OpenStoreAndAddProducts();
            _orderBridge     = OrderDriver.getBridge();
            _userAdminBridge = UserDriver.getBridge();
            _userAdminBridge.EnterSystem();
            MarketAnswer res = _userAdminBridge.SignIn("Arik1", "123");

            _adminBridge = AdminDriver.getBridge();
            _adminBridge.GetAdminService(_userAdminBridge.GetUserSession());
            _buyerRegisteredUserBridge = null;
            _buyerGuestBridge          = null;
            PaymentService.Instance.FixExternal();
            SupplyService.Instance.FixExternal();
        }
Пример #18
0
 public void MarketBuilder()
 {
     MarketYard.SetDateTime(Convert.ToDateTime("14/04/2018"));
     MarketDB.Instance.InsertByForce();
     SignUpStoreOwner("Pnina", "mishol", "666", "66666666");
     OpenStoreAndAddProducts();
     _userAdminBridge = UserDriver.getBridge();
     _userAdminBridge.EnterSystem();
     _userAdminBridge.SignIn("Arik1", "123");
     _adminBridge = AdminDriver.getBridge();
     _adminBridge.GetAdminService(_userAdminBridge.GetUserSession());
     _buyerRegisteredUserBridge1 = null;
     _buyerRegisteredUserBridge2 = null;
     _buyerRegisteredUserBridge3 = null;
     _orderBridge1     = null;
     _orderBridge2     = null;
     _orderBridge3     = null;
     _buyerGuestBridge = null;
     PaymentService.Instance.FixExternal();
     SupplyService.Instance.FixExternal();
 }
Пример #19
0
        private void AddProductsToCartGuest()
        {
            _buyerGuestBridge = UserDriver.getBridge();
            _buyerGuestBridge.EnterSystem();
            _shoppingBridge2 = StoreShoppingDriver.getBridge();
            _shoppingBridge2.GetStoreShoppingService(_buyerGuestBridge.GetUserSession());
            _shoppingBridge2.AddProductToCart("Yalla", "Tea", 4);
            _shoppingBridge2.AddProductToCart("HAHAHA", "Coffee", 3);
            MarketAnswer cartDetails = _buyerGuestBridge.ViewCart();

            string[] received = cartDetails.ReportList;
            string[] expected =
            {
                "Name : Coffee Store : HAHAHA Quantity : 3 Unit Price : 10 Final Price : 30",
                "Name : Tea Store : Yalla Quantity : 4 Unit Price : 10 Final Price : 40"
            };

            Assert.AreEqual(expected.Length, cartDetails.ReportList.Length);
            for (int i = 0; i < received.Length; i++)
            {
                Assert.AreEqual(expected[i], received[i]);
            }
        }
Пример #20
0
 private void GuestEnter()
 {
     _guestBridge = UserDriver.getBridge();
     _guestBridge.EnterSystem();
 }
Пример #21
0
 private void SignIn(string name, string password)
 {
     _signInBridge = UserDriver.getBridge();
     _signInBridge.EnterSystem();
     _signInBridge.SignIn(name, password);
 }
Пример #22
0
 private void SignUp(ref IUserBridge userBridge, string name, string address, string password, string creditCard)
 {
     userBridge = UserDriver.getBridge();
     userBridge.EnterSystem();
     userBridge.SignUp(name, address, password, creditCard);
 }
Пример #23
0
 private void SignIn()
 {
     _signInBridge = UserDriver.getBridge();
     _signInBridge.EnterSystem();
     _signInBridge.SignUp("Pninaaa", "aaaaa", "777777", "44444444");
 }
Пример #24
0
 private void SignInAdmin(string name, string password)
 {
     _userAdmin = UserDriver.getBridge();
     _userAdmin.EnterSystem();
     _userAdmin.SignIn(name, password);
 }
Пример #25
0
 private void SignUpStoreOwner(string name, string address, string password, string creditCard)
 {
     _storeOwnerBridge = UserDriver.getBridge();
     _storeOwnerBridge.EnterSystem();
     _storeOwnerBridge.SignUp(name, address, password, creditCard);
 }
Пример #26
0
 private void CreateUser2()
 {
     _userBridge2 = UserDriver.getBridge();
     _userBridge2.EnterSystem();
     _userBridge2.SignUp("Maor", "vinget", "9999", "99999999");
 }
Пример #27
0
 private void SignUp(string name, string address, string password, string creditCard)
 {
     _bridgeSignUp = UserDriver.getBridge();
     _bridgeSignUp.EnterSystem();
     _bridgeSignUp.SignUp(name, address, password, creditCard);
 }
Пример #28
0
 private void CreateUser1()
 {
     _userBridge = UserDriver.getBridge();
     _userBridge.EnterSystem();
     _userBridge.SignUp("Pnina", "misholSusia", "852852", "77777777");
 }
Пример #29
0
 public void MarketBuilder()
 {
     MarketDB.Instance.InsertByForce();
     _bridgeSignIn = UserDriver.getBridge();
 }
Пример #30
0
 private void SignIn(string userName, string password)
 {
     _adminSignInBridge = UserDriver.getBridge();
     _adminSignInBridge.EnterSystem();
     _adminSignInBridge.SignIn(userName, password);
 }