Beispiel #1
0
        public void SetUp()
        {
            DbCommerce.GetInstance().StartTests();
            LinkedList <string> policy = new LinkedList <string>();

            system = Workshop192.MarketManagment.System.GetInstance();
            AllRegisteredUsers.GetInstance().CreateUser();
            user = AllRegisteredUsers.GetInstance().GetUser(1);
            system.OpenStore("store1");
            system.OpenStore("store2");
            store1   = system.GetStore("store1");
            store2   = system.GetStore("store2");
            product1 = new Product(1, "", "", 10);
            product2 = new Product(2, "", "", 20);
            product3 = new Product(3, "", "", 30);
            product4 = new Product(4, "", "", 40);
            store1.AddProducts(product1, 10);
            store1.AddProducts(product2, 10);
            store2.AddProducts(product3, 10);
            store2.AddProducts(product4, 10);
            policy.AddLast("Ban"); policy.AddLast("AND"); policy.AddLast("1"); policy.AddLast("user");
            product1.AddDiscountPolicy(policy, 50);
            policy = new LinkedList <string>();
            policy.AddLast("Min"); policy.AddLast("AND"); policy.AddLast("1"); policy.AddLast("0"); policy.AddLast("5");
            product1.AddSellingPolicy(policy);
            policy = new LinkedList <string>();
            policy.AddLast("Min"); policy.AddLast("AND"); policy.AddLast("0"); policy.AddLast("0"); policy.AddLast("5");
            store1.AddSellingPolicy(policy);
            policy = new LinkedList <string>();
            policy.AddLast("Max"); policy.AddLast("AND"); policy.AddLast("0"); policy.AddLast("0"); policy.AddLast("50");
            store1.AddSellingPolicy(policy);
        }
Beispiel #2
0
 public void TearDown()
 {
     DbCommerce.GetInstance().EndTests();
     system = Workshop192.MarketManagment.System.Reset();
     AllRegisteredUsers.Reset();
 }