Example #1
0
        public void TestInitialize()
        {
            User user = new User(1, null, true, true);

            List <Tuple <Product, int> > lstProds = new List <Tuple <Product, int> >();

            lstProds.Add(new Tuple <Product, int>(new Product(pid: 1, sid: 1, price: 10000, name: "Dell Xps 9560", rank: 4, category: CommonStr.ProductCategoty.Computers), 100));
            lstProds.Add(new Tuple <Product, int>(new Product(pid: 2, sid: 1, name: "Ninja Blender V3", price: 450, rank: 2, category: CommonStr.ProductCategoty.Kitchen), 200));
            lstProds.Add(new Tuple <Product, int>(new Product(pid: 3, sid: 1, name: "MegaMix", price: 1000, rank: 5, category: CommonStr.ProductCategoty.Kitchen), 300));
            lstProds.Add(new Tuple <Product, int>(new Product(pid: 4, sid: 1, name: "makeup loreal paris", price: 200, rank: 3, category: CommonStr.ProductCategoty.Beauty), 0));
            inv_store_1 = InventoryTest.getInventory(lstProds);
            Store store1 = StoreTest.StoreTest.openStore(storeId: 1, user: user, inv: inv_store_1, rank: 4);

            List <Tuple <Product, int> > lstProds2 = new List <Tuple <Product, int> >();

            lstProds2.Add(new Tuple <Product, int>(new Product(pid: 1, sid: 2, price: 650, name: "Keyboard Mx95 Lgoitech", rank: 4, category: CommonStr.ProductCategoty.Computers), 100));
            lstProds2.Add(new Tuple <Product, int>(new Product(pid: 2, sid: 2, name: "Elctricty Knife", price: 450, rank: 5, category: CommonStr.ProductCategoty.Kitchen), 200));
            lstProds2.Add(new Tuple <Product, int>(new Product(pid: 3, sid: 2, name: "MegaMix v66", price: 1500, rank: 1, category: CommonStr.ProductCategoty.Kitchen), 300));
            lstProds2.Add(new Tuple <Product, int>(new Product(pid: 4, sid: 2, name: "Lipstick in955", price: 200, rank: 3, category: CommonStr.ProductCategoty.Beauty), 10));
            inv_store_2 = InventoryTest.getInventory(lstProds2);
            Store store2 = StoreTest.StoreTest.openStore(storeId: 2, user: user, inv: inv_store_2, rank: 3);

            List <Tuple <Product, int> > lstProd3 = new List <Tuple <Product, int> >();

            lstProd3.Add(new Tuple <Product, int>(new Product(pid: 1, sid: 3, price: 50, name: "Mouse Mx95 Lgoitech", rank: 2, category: CommonStr.ProductCategoty.Computers), 100));
            lstProd3.Add(new Tuple <Product, int>(new Product(pid: 2, sid: 3, name: "Nespresso Latsima Touch Coffe Machine", price: 1400, rank: 2, category: CommonStr.ProductCategoty.Kitchen), 200));
            lstProd3.Add(new Tuple <Product, int>(new Product(pid: 3, sid: 3, name: "MegaMix v41", price: 1500, rank: 4, category: CommonStr.ProductCategoty.Kitchen), 300));
            lstProd3.Add(new Tuple <Product, int>(new Product(pid: 4, sid: 3, name: "makeup loreal paris", price: 200, rank: 5, category: CommonStr.ProductCategoty.Beauty), 10));
            inv_store_3 = InventoryTest.getInventory(lstProd3);
            Store store3 = StoreTest.StoreTest.openStore(storeId: 3, user: user, inv: inv_store_3, rank: 1);

            Dictionary <int, Store> storesDictionary = new Dictionary <int, Store>();

            storesDictionary.Add(1, store1);
            storesDictionary.Add(2, store2);
            storesDictionary.Add(3, store3);
            storeManagment = StoreManagment.Instance;
            storeManagment.setStores(storesDictionary);
            searcher = new Searcher(storeManagment);
        }