public void BadCombo1() { AddPolicySlave slave = new AddPolicySlave(admin.Object, manager.Object); slave.CreatePolicy("Global", null, "Quantity <=", "shit", ""); Assert.AreEqual((int)EditPolicyStatus.InvalidPolicyData, slave.Answer.Status); }
public void AddGlobalPolicySuccess() { AddPolicySlave slave = new AddPolicySlave(admin.Object, manager.Object); slave.CreatePolicy("Global", null, "Quantity <=", "5", ""); Assert.AreEqual((int)EditPolicyStatus.Success, slave.Answer.Status); }
public void BadCategoryPolicyType() { AddPolicySlave slave = new AddPolicySlave(admin.Object, manager.Object); slave.CreatePolicy("Category", "", "Quantity <=", "5", ""); Assert.AreEqual((int)EditPolicyStatus.InvalidPolicyData, slave.Answer.Status); }
public void AddCategoryPolicySuccess() { AddPolicySlave slave = new AddPolicySlave(admin.Object, manager.Object); slave.CreatePolicy("Category", "Shitty Products", "Quantity <=", "5", ""); Assert.AreEqual((int)EditPolicyStatus.Success, slave.Answer.Status); }
public void BadCombo1() { AddPolicySlave slave = new AddPolicySlave(seller.Object, manager.Object); slave.CreatePolicy("StockItem", "Cluckin Bell", "#9", "Quantity <=", "shit", ""); Assert.AreEqual((int)EditStorePolicyStatus.InvalidPolicyData, slave.Answer.Status); }
public void BadPolicyType() { AddPolicySlave slave = new AddPolicySlave(seller.Object, manager.Object); slave.CreatePolicy("Shit", null, "#9", "Quantity <=", "5", ""); Assert.AreEqual((int)EditStorePolicyStatus.InvalidPolicyData, slave.Answer.Status); }
public void AddStorePolicySuccess() { AddPolicySlave slave = new AddPolicySlave(seller.Object, manager.Object); slave.CreatePolicy("Store", "Cluckin Bell", null, "Quantity <=", "5", ""); Assert.AreEqual((int)EditStorePolicyStatus.Success, slave.Answer.Status); }
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); }
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); }
public void NoAuthority1() { admin.Setup(x => x.ValidateSystemAdmin()) .Throws(new MarketException((int)ManageMarketSystem.NotSystemAdmin, "")); AddPolicySlave slave = new AddPolicySlave(admin.Object, manager.Object); slave.CreatePolicy("Global", null, "Quantity <=", "5", ""); Assert.AreEqual((int)EditPolicyStatus.NoAuthority, slave.Answer.Status); }
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); }
public void NoAuthority1() { seller.Setup(x => x.CanDeclarePurchasePolicy()) .Throws(new MarketException((int)PromoteStoreStatus.NoAuthority, "")); AddPolicySlave slave = new AddPolicySlave(seller.Object, manager.Object); slave.CreatePolicy("StockItem", null, null, "Quantity <=", "5", ""); Assert.AreEqual((int)EditStorePolicyStatus.NoAuthority, slave.Answer.Status); }