Esempio n. 1
0
        public void SavePolicySuccess2()
        {
            AddPolicySlave slave = new AddPolicySlave(admin.Object, manager.Object);

            slave.CreatePolicy("Category", "Shitty Products", "Address =", "Sunnyvale", "");
            slave.SaveFullPolicy();
            Assert.AreEqual((int)EditPolicyStatus.Success, slave.Answer.Status);
        }
Esempio n. 2
0
        public void SavePolicySuccess()
        {
            AddPolicySlave slave = new AddPolicySlave(seller.Object, manager.Object);

            slave.CreatePolicy("StockItem", "Cluckin Bell", "#9", "Quantity <=", "5", "");
            slave.SaveFullPolicy();
            Assert.AreEqual((int)EditStorePolicyStatus.Success, slave.Answer.Status);
        }
Esempio n. 3
0
        public void NoAuthority2()
        {
            admin.Setup(x => x.ValidateSystemAdmin())
            .Throws(new MarketException((int)ManageMarketSystem.NotSystemAdmin, ""));
            AddPolicySlave slave = new AddPolicySlave(admin.Object, manager.Object);

            slave.SaveFullPolicy();
            Assert.AreEqual((int)EditPolicyStatus.NoAuthority, slave.Answer.Status);
        }
Esempio n. 4
0
        public void NoAuthority2()
        {
            seller.Setup(x => x.CanDeclarePurchasePolicy())
            .Throws(new MarketException((int)PromoteStoreStatus.NoAuthority, ""));
            AddPolicySlave slave = new AddPolicySlave(seller.Object, manager.Object);

            slave.SaveFullPolicy();
            Assert.AreEqual((int)EditStorePolicyStatus.NoAuthority, slave.Answer.Status);
        }