예제 #1
0
        public void BadCategoryType()
        {
            RemovePolicySlave slave = new RemovePolicySlave(admin.Object, manager.Object);

            slave.RemovePolicy("Category", null);
            Assert.AreEqual((int)EditPolicyStatus.InvalidPolicyData, slave.Answer.Status);
        }
예제 #2
0
        public void RemovePolicySuccess()
        {
            RemovePolicySlave slave = new RemovePolicySlave(admin.Object, manager.Object);

            slave.RemovePolicy("Category", "Shit");
            Assert.AreEqual((int)EditPolicyStatus.Success, slave.Answer.Status);
        }
예제 #3
0
        public void BadGlobalPolicyType()
        {
            RemovePolicySlave slave = new RemovePolicySlave(admin.Object, manager.Object);

            slave.RemovePolicy("Global", "shit");
            Assert.AreEqual((int)EditPolicyStatus.InvalidPolicyData, slave.Answer.Status);
        }
예제 #4
0
        public void RemovePolicySuccess()
        {
            RemovePolicySlave slave = new RemovePolicySlave(seller.Object, manager.Object);

            slave.RemovePolicy("StockItem", "Cluckin Bell", "#9");
            Assert.AreEqual((int)EditStorePolicyStatus.Success, slave.Answer.Status);
        }
예제 #5
0
        public void BadStorePolicyType()
        {
            RemovePolicySlave slave = new RemovePolicySlave(seller.Object, manager.Object);

            slave.RemovePolicy("Store", "Cluckin Bell", "#9");
            Assert.AreEqual((int)EditStorePolicyStatus.InvalidPolicyData, slave.Answer.Status);
        }
예제 #6
0
        public void NoAuthority()
        {
            admin.Setup(x => x.ValidateSystemAdmin())
            .Throws(new MarketException((int)ManageMarketSystem.NotSystemAdmin, ""));
            RemovePolicySlave slave = new RemovePolicySlave(admin.Object, manager.Object);

            slave.RemovePolicy("Global", null);
            Assert.AreEqual((int)EditPolicyStatus.NoAuthority, slave.Answer.Status);
        }
예제 #7
0
        public void NoAuthority()
        {
            seller.Setup(x => x.CanDeclarePurchasePolicy())
            .Throws(new MarketException((int)PromoteStoreStatus.NoAuthority, ""));
            RemovePolicySlave slave = new RemovePolicySlave(seller.Object, manager.Object);

            slave.RemovePolicy("StockItem", "Cluckin Bell", "#9");
            Assert.AreEqual((int)EditStorePolicyStatus.NoAuthority, slave.Answer.Status);
        }