Exemplo n.º 1
0
        public void TestMethod1_fail_userClass_scenario()
        {
            setUp();
            StubStore sStore = new StubStore(3456, "nike", null, null, true);

            Assert.AreEqual(false, ownerUser.assignManager(user1, sStore.Id, permissions));
        }
Exemplo n.º 2
0
        public void removePurchasePolicy_user_fail()
        {
            setUp();
            StubStore sStore = new StubStore(1234, "nike", null, null, 0);
            int       ans    = admin.removePurchasePolicy(pcp.getId(), sStore.Id);

            Assert.AreEqual(-1, ans);
        }
        public void removeRevealedDiscountPolicy_user_fail()
        {
            setUp();
            StubStore sStore = new StubStore(1234, "nike", null, null, 0);
            int       ans    = admin.removeDiscountPolicy(discountId, sStore.Id);

            Assert.AreEqual(-1, ans);
        }
Exemplo n.º 4
0
        public void TestMethod1_success_userClass_scenario()
        {
            setUp();
            StubStore sStore = new StubStore(3456, "nike", null, null, true);

            ownerUser.Roles.Add(sStore.Id, ownerRole);
            Assert.AreEqual(true, ownerUser.assignManager(managerUser, sStore.Id, permissions));
        }
Exemplo n.º 5
0
        public void removePurchasePolicy_user_succ()
        {
            setUp();
            StubStore sStore = new StubStore(1234, "nike", null, null, 0);
            StubRole  sRole  = new StubRole(sStore, ownerUser, 0);

            ownerUser.Roles.Add(sStore.Id, sRole);
            int ans = ownerUser.removePurchasePolicy(pcp.getId(), sStore.Id);

            Assert.AreEqual(0, ans);
        }
Exemplo n.º 6
0
        public void removePurchasePolicy_role_succ()
        {
            setUp();
            StubStore sStore    = new StubStore(1234, "nike", null, null, 0);
            Role      ownerStub = new Role(sStore, ownerUser);

            ownerUser.Roles.Add(sStore.Id, ownerRole);
            int ans = ownerStub.removePurchasePolicy(pcp.getId());

            Assert.AreEqual(0, ans);
        }
Exemplo n.º 7
0
        public void removePurchasePolicy_tradingSystem_fail()
        {
            setUp();
            StubStore sStore  = new StubStore(1234, "nike", null, null, 0);
            StubUser  tmpUser = new StubUser(2222, "owner", "7878", false, true, 0);

            system.Users.Add(tmpUser.Id, tmpUser);
            int ans = system.removePurchasePolicy(pcp.getId(), sStore.Id, tmpUser.Id);

            Assert.AreEqual(-1, ans);
        }
Exemplo n.º 8
0
        public void addRevealedDiscountPolicy_tradingSystem_succ()
        {
            setUp();
            StubStore sStore  = new StubStore(3456, "nike", null, null, 1);
            StubUser  tmpUser = new StubUser(2222, "owner", "7878", false, true, 1);

            system.Users.Add(tmpUser.Id, tmpUser);
            int ans = system.addConditionalDiscuntPolicy(products, "", 20, 40, 0, 0, tmpUser.Id, sStore.Id);

            Assert.AreEqual(1, ans);
        }
Exemplo n.º 9
0
        public void addRevealedDiscountPolicy_user_fail()
        {
            setUp();
            StubStore sStore = new StubStore(3456, "nike", null, null, 1);
            StubRole  sRole  = new StubRole(sStore, admin, 1);

            admin.Roles.Add(sStore.Id, sRole);
            int ans = admin.addConditionalDiscuntPolicy(products, "", 20, 40, duplicate, logic, 0, sStore.Id);

            Assert.AreEqual(-1, ans);
        }
        public void removeRevealedDiscountPolicy_user_succ()
        {
            setUp();
            StubStore sStore = new StubStore(1234, "nike", null, null, 0);
            StubRole  sRole  = new StubRole(sStore, ownerUser, 0);

            ownerUser.Roles.Add(sStore.Id, sRole);
            int ans = ownerUser.removeDiscountPolicy(discountId, sStore.Id);

            Assert.AreEqual(0, ans);
        }
        public void removeRevealedDiscountPolicy_tradingSystem_succ()
        {
            setUp();
            StubStore sStore  = new StubStore(1234, "nike", null, null, 0);
            StubUser  tmpUser = new StubUser(2222, "owner", "7878", false, true, 0);

            system.Users.Add(tmpUser.Id, tmpUser);
            int ans = system.removeDiscountPolicy(discountId, sStore.Id, tmpUser.Id);

            Assert.AreEqual(0, ans);
        }
        public void addRevealedDiscountPolicy_user_succ()
        {
            setUp();
            StubStore sStore = new StubStore(3456, "nike", null, null, 1);
            StubRole  sRole  = new StubRole(sStore, ownerUser, 1);

            ownerUser.Roles.Add(sStore.Id, sRole);
            int ans = ownerUser.addRevealedDiscountPolicy(products, 50, sStore.Id, 20, 1, logic);

            Assert.AreEqual(1, ans);
        }
        public void addRevealedDiscountPolicy_user_fail()
        {
            setUp();
            StubStore sStore = new StubStore(3456, "nike", null, null, 1);
            StubRole  sRole  = new StubRole(sStore, admin, 1);

            admin.Roles.Add(sStore.Id, sRole);
            int ans = admin.addRevealedDiscountPolicy(products, 50, sStore.Id, 20, 1, logic);

            Assert.AreEqual(-1, ans);
        }
Exemplo n.º 14
0
        public void TestMethod1_fail_system_scenario()
        {
            setUp();
            StubStore sStore          = new StubStore(3456, "nike", null, null, false);
            StubUser  ownerUserStub   = new StubUser(2222, "owner", "7878", false, true, false);
            StubUser  managerUserStub = new StubUser(2323, "babi", "3434", false, true, false);

            system.Users.Add(ownerUserStub.Id, ownerUserStub);
            system.Stores.Add(sStore.Id, sStore);
            Assert.AreEqual(false, system.assignManager(ownerUser.Id, user1.Id, store.Id, permissions));
        }
Exemplo n.º 15
0
        public void addRevealedDiscountPolicy_role_succ()
        {
            setUp();
            StubStore sStore    = new StubStore(1234, "nike", null, null, 1);
            Role      ownerStub = new Role(sStore, ownerUser);

            ownerUser.Roles.Add(sStore.Id, ownerRole);
            int ans = ownerStub.addConditionalDiscuntPolicy(products, "", 20, date1, 1, duplicate, logic);

            Console.WriteLine(ans);
            Assert.AreEqual(1, ans);
        }