コード例 #1
0
        public void setUp()
        {
            service = ServiceLayer.getInstance(false);
            DBtransactions db = DBtransactions.getInstance(true);

            db.isTest(true);
            idOwner      = service.initUser();
            ownerUser    = "******";
            passwordUser = "******";
            service.register(ownerUser, passwordUser, idOwner);
            service.signIn(ownerUser, passwordUser);

            idUser   = service.initUser();
            tmpUser  = "******";
            passUser = "******";
            service.register(tmpUser, passUser, idUser);

            service.openStore("adidas", ownerUser);
            service.createNewProductInStore("milk", "milk", "none", 10, "adidas", ownerUser);
            products = new List <KeyValuePair <String, int> >();
            products.Add(new KeyValuePair <string, int>("milk", 7));
            service.addProductsInStore(products, "adidas", ownerUser);

            productsInCart = new List <KeyValuePair <String, int> >();
            productsInCart.Add(new KeyValuePair <string, int>("milk", 10));
        }
コード例 #2
0
        public void setUp()
        {
            service = ServiceLayer.getInstance(false);
            idOwner = service.initUser();
            DBtransactions db = DBtransactions.getInstance(true);

            db.isTest(true);
            ownerUser    = "******";
            passwordUser = "******";
            service.register(ownerUser, passwordUser, idOwner);
            service.signIn(ownerUser, passwordUser);

            idManager       = service.initUser();
            managerUser     = "******";
            managerPassword = "******";
            service.register(managerUser, managerPassword, idManager);
            permissions = new List <String>()
            {
                "AddDiscountPolicy"
            };


            service.openStore("adidas", ownerUser);

            idGuest   = service.initUser();
            guestUser = "******";
            password  = "******";
        }
コード例 #3
0
        public void TestMethod1_success_scenario()
        {
            setUp();
            DBtransactions db = DBtransactions.getInstance(true);

            db.isTest(true);
            String userName = user1.UserName;
            String password = "******";
            int    userId   = user1.Id;

            Assert.AreEqual(true, system.register(userName, password, userId));
        }
コード例 #4
0
ファイル: registerUserTest.cs プロジェクト: MaorSagi/wsep192
        public void TestMethod1_success_scenario()
        {
            setUp();
            DBtransactions db = DBtransactions.getInstance(true);

            db.isTest(true);
            StubUser tmpUser  = new StubUser(123, "yuval", "4567", false, false, true);
            String   userName = tmpUser.UserName;
            String   password = tmpUser.Password;
            int      userId   = tmpUser.Id;

            system.Users.Add(tmpUser.Id, tmpUser);
            Assert.AreEqual(true, system.register(userName, password, userId));
        }
コード例 #5
0
        public void setUp()
        {
            service = ServiceLayer.getInstance(false);
            DBtransactions db = DBtransactions.getInstance(true);

            db.isTest(true);
            string owner = service.initUser();

            service.register("Rotem", "23&As2", owner);
            service.signIn("Rotem", "23&As2");
            service.openStore("ZARA", "Rotem");
            string user = service.initUser();

            service.register("Noy", "24!tr4", user);
            service.signIn("Noy", "24!tr4");
        }
コード例 #6
0
        public void setUp()
        {
            service = ServiceLayer.getInstance(false);
            DBtransactions db = DBtransactions.getInstance(true);

            db.isTest(true);
            string owner = service.initUser();

            service.register("Rotem", "23&As2", owner);
            service.signIn("Rotem", "23&As2");
            service.openStore("ZARA", "Rotem");
            string user = service.initUser();

            service.register("Noy", "24!tr4", user);
            service.signIn("Noy", "24!tr4");
            service.createNewProductInStore("Top", "Tank tops", "Light blue", 89, "ZARA", "Rotem");
            products = new List <KeyValuePair <String, int> >();
            products.Add(new KeyValuePair <string, int>("Top", 7));
            service.addProductsInStore(products, "ZARA", "Rotem");
        }