Example #1
0
 AppoitmentManager()
 {
     UM             = UserManager.Instance;
     storeManagment = StoreManagment.Instance;
     AllAppoitments = new List <Appoitment>();
     AllCandidates  = new List <Candidation>();
 }
Example #2
0
 public void cleanup()
 {
     Logger.logEvent(this, System.Reflection.MethodBase.GetCurrentMethod());
     storeManagment = StoreManagment.Instance;
     UM             = UserManager.Instance;
     //publisher = Publisher.Instance;
 }
    void OnMouseDown()
    {
        int   nowGold         = gameManagment.Instance.getGold();
        float tempCastleHp    = gameManagment.Instance.getCastleHp();
        float tempCastleHpMax = gameManagment.Instance.getCastleHpMax();

        switch (menuNumber)
        {
        case 0:
        {
            Application.LoadLevel("GameScene");
            break;
        }

        case 1:
        {
            Application.LoadLevel("StoreSceneDetail_d");
            break;
        }

        case 2:
        {
            Application.LoadLevel("StoreSceneDetail_s");
            break;
        }
        }

        GameObject     storeObejct    = GameObject.Find("MainCamera");
        StoreManagment storeManagment = storeObejct.GetComponent <StoreManagment>();

        storeManagment.updateUI();
    }
Example #4
0
        public static Store initValidStore()
        {
            StoreManagment sm          = StoreManagment.Instance;
            UserManager    userManager = UserManager.Instance;

            userManager.Register("shimon", "123");
            userManager.Login("shimon", "123", false);
            sm.createStore("shimon", "Store");
            userManager.Register("yosi", "123");
            userManager.Login("yosi", "123");
            userManager.Register("shmuel", "123");
            userManager.Login("shmuel", "123");
            AppoitmentManager appmgr = AppoitmentManager.Instance;

            appmgr.AppointStoreManager("shimon", "shmuel", 100);
            appmgr.AppointStoreManager("shimon", "yosi", 100);
            userManager.GetAtiveUser("shmuel").setPermmisions(100, new int[] { 0, 0, 1, 0, 0 });
            userManager.GetAtiveUser("yosi").setPermmisions(100, new int[] { 1, 1, 0, 0, 0 });

            Store validStore = sm.getStore(100);

            validStore.Inventory = InventoryTest.getInventory(InventoryTest.getValidInventroyProdList());

            return(validStore);
        }
 private PurchaseManagement(PaymentHandler paymentHandler, DeliveryHandler deliveryHandler)
 {
     ClearAll();
     this.storeManagment  = StoreManagment.Instance;
     this.paymentHandler  = paymentHandler;
     this.deliveryHandler = deliveryHandler;
     this.userManager     = UserManager.Instance;
 }
Example #6
0
        public void TestInitialize()
        {
            SM = StoreManagment.Instance;
            UM = UserManager.Instance;
            AP = AppoitmentManager.Instance;

            UM.Register("owner", "Test1");
            UM.Register("Appointed", "Test1");
            UM.Login("owner", "Test1");
            UM.Login("Appointed", "Test1");
        }
 /// <summary>
 /// Setup the dependencies of this class for tests purposes
 /// </summary>
 public void SetupDependencies(
     StoreManagment storeManagment,
     PaymentHandler paymentHandler,
     DeliveryHandler deliveryHandler,
     UserManager userManager)
 {
     this.storeManagment  = storeManagment;
     this.userManager     = userManager;
     this.paymentHandler  = paymentHandler;
     this.deliveryHandler = deliveryHandler;
 }
Example #8
0
 public void TestInitialize()
 {
     apm                = AppoitmentManager.Instance;
     sm                 = StoreManagment.Instance;
     store              = StoreTest.initValidStore();
     userManager        = UserManager.Instance;
     purchaseManagement = PurchaseManagement.Instance;
     UserManager.Instance.Register(buyer, "123");
     UserManager.Instance.Login(buyer, "123");
     UserManager.Instance.RegisterMaster(admin, admin);
     UserManager.Instance.Login(admin, admin);
 }
Example #9
0
 public void TestInitialize()
 {
     PaymentDetails  = "3333444455556666&4&11&Wolloloo&333&222222222";
     DeliveryDetails = "dani&Wollu&Wollurberg&wolocountry&12345678";
     SM = StoreManagment.Instance;
     UM = UserManager.Instance;
     AP = AppoitmentManager.Instance;
     purchaseManagement = PurchaseManagement.Instance;
     UM.Register("owner", "Test1");
     UM.Register("Appointed", "Test1");
     UM.Login("owner", "Test1");
     UM.Login("Appointed", "Test1");
     SM.createStore("owner", "Store");
     SM.getStore(100).Inventory = getInventory(getValidInventroyProdList());
 }
 public void TestInitialize()
 {
     //SM.cleanup();
     //UM.cleanup();
     //Publisher.Instance.cleanup();
     Statistics.Instance.cleanup();
     UM = UserManager.Instance;
     SM = StoreManagment.Instance;
     UM.RegisterMaster("Admin", "Test1");
     UM.Register("user7", "Test1");
     UM.Register("user8", "Test1");
     UM.Login("Admin", "Test1");
     UM.Login("user8", "Test1");
     SM.createStore("user8", "Store1");
 }
Example #11
0
    void OnMouseDown()
    {
        int   nowGold         = gameManagment.Instance.getGold();
        float tempCastleHp    = gameManagment.Instance.getCastleHp();
        float tempCastleHpMax = gameManagment.Instance.getCastleHpMax();

        switch (m_nMenuId)
        {
        case 0:
        {
            Application.LoadLevel("StoreScene");
            break;
        }

        case 1:
        {
            if ((nowGold - 10) >= 0 && tempCastleHp != tempCastleHpMax)
            {
                gameManagment.Instance.setGold(nowGold - 10);
                if ((tempCastleHp + 30.0f) >= tempCastleHpMax)
                {
                    gameManagment.Instance.setCastleHp(tempCastleHpMax);
                }
                else
                {
                    gameManagment.Instance.setCastleHp(tempCastleHp + 30.0f);
                }
            }
            break;
        }

        case 2:
        {
            if ((nowGold - 30) >= 0)
            {
                gameManagment.Instance.setGold(nowGold - 30);
                gameManagment.Instance.setCastleHpMax(tempCastleHpMax + 20.0f);
            }
            break;
        }
        }

        GameObject     storeObejct    = GameObject.Find("MainCamera");
        StoreManagment storeManagment = storeObejct.GetComponent <StoreManagment>();

        storeManagment.updateUI();
    }
Example #12
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);
        }
 public void TestInitialize()
 {
     SM = StoreManagment.Instance;
     UM = UserManager.Instance;
     AP = AppoitmentManager.Instance;
     UM.Register("owner", "Test1");
     UM.Register("Appointed", "Test1");
     UM.Login("owner", "Test1");
     UM.Login("Appointed", "Test1");
     UM.Login("", "G", true);
     SM.createStore("owner", "Store");
     UM.Register("user1", "Test1");
     UM.Register("user2", "Test1");
     UM.Register("user3", "Test1");
     Assert.IsNotNull(UM.GetAtiveUser("owner"));
     Assert.IsNotNull(UM.GetAtiveUser("Appointed"));
     Assert.IsNotNull(UM.GetAtiveUser("Guest3"));
     Assert.IsTrue(UM.GetAtiveUser("Guest3").isguest());
     Assert.IsTrue(UM.GetAtiveUser("owner").isStoreOwner(100));
     Assert.IsTrue(SM.getStore(100).IsStoreOwner(UM.GetAtiveUser("owner")));
     Assert.IsNotNull(SM.getStore(100));
 }
Example #14
0
 public StoreService()
 {
     this.storeManagment = StoreManagment.Instance;
     this.searcher       = new Searcher(storeManagment);
 }
 public void TestInitialize()
 {
     storeManagment = StoreManagetTest.getValidStoreManagmet();
     userManger     = UserManager.Instance;
 }