Ejemplo n.º 1
0
        public void ItemExpenditureNotebook_UT3()
        {
            StockManager       stockMgr       = new StockManager();
            TransactionManager transactoinMgr = new TransactionManager();
            Employee_UI        empUI          = new Employee_UI(stockMgr, transactoinMgr);

            empUI.AddToStock(1, "Pen", 50, 720, DateTime.Now);
            empUI.AddToStock(1, "Pen", 50, 720, DateTime.Now);
            empUI.AddToStock(2, "Notebook", 10, Convert.ToDecimal(80.25), DateTime.Now);
            empUI.AddToStock(2, "Notebook", 10, Convert.ToDecimal(80.25), DateTime.Now);
            List <Transaction>        transactions = empUI.ViewFinancialReport();
            Dictionary <int, decimal> expenditure  = CalcExpenditure(transactions);

            Assert.AreEqual(Convert.ToDecimal(160.5), expenditure[2]);
        }
Ejemplo n.º 2
0
        public void ItemPricePaidReadAdd_UT1()
        {
            StockManager       stockMgr       = new StockManager();
            TransactionManager transactoinMgr = new TransactionManager();
            Employee_UI        empUI          = new Employee_UI(stockMgr, transactoinMgr);

            empUI.AddToStock(1, "Pen", 50, 720, DateTime.Now);
            Assert.AreEqual(720, transactoinMgr.Transaction[0].PricePaid);
        }
Ejemplo n.º 3
0
        public void ItemQuantityReadAdd_UT1()
        {
            StockManager       stockMgr       = new StockManager();
            TransactionManager transactoinMgr = new TransactionManager();
            Employee_UI        empUI          = new Employee_UI(stockMgr, transactoinMgr);

            empUI.AddToStock(1, "Pen", 50, 720, DateTime.Now);
            Assert.AreEqual(50, stockMgr.FindStock(1).Quantity);
        }
Ejemplo n.º 4
0
        public void ItemQuantityBoundary_UT4()
        {
            StockManager       stockMgr       = new StockManager();
            TransactionManager transactoinMgr = new TransactionManager();
            Employee_UI        empUI          = new Employee_UI(stockMgr, transactoinMgr);

            empUI.AddToStock(1, "Pen", 1, Convert.ToDecimal(7.4), DateTime.Now);
            Assert.AreEqual(1, stockMgr.FindStock(1).Quantity);
        }
Ejemplo n.º 5
0
        public void ItemQuantityReadRemove_UT2()
        {
            StockManager       stockMgr       = new StockManager();
            TransactionManager transactoinMgr = new TransactionManager();
            Employee_UI        empUI          = new Employee_UI(stockMgr, transactoinMgr);

            empUI.AddToStock(1, "Pen", 50, 720, DateTime.Now);
            empUI.TakeFromStock(1, 20, "Euan Martin".ToLower(), DateTime.Now);
            Assert.AreEqual(20, 50 - stockMgr.FindStock(1).Quantity);
        }
Ejemplo n.º 6
0
        public void PersonReadRemove_UT2()
        {
            StockManager       stockMgr       = new StockManager();
            TransactionManager transactoinMgr = new TransactionManager();
            Employee_UI        empUI          = new Employee_UI(stockMgr, transactoinMgr);

            empUI.AddToStock(1, "Pen", 50, 720, DateTime.Now);
            empUI.TakeFromStock(1, 20, "Euan Martin".ToLower(), DateTime.Now);
            Assert.AreEqual("euan martin", transactoinMgr.Transaction[1].PersonName);
        }
Ejemplo n.º 7
0
        public void ItemDateAddedReadAdd_UT1()
        {
            StockManager       stockMgr       = new StockManager();
            TransactionManager transactoinMgr = new TransactionManager();
            Employee_UI        empUI          = new Employee_UI(stockMgr, transactoinMgr);
            DateTime           dateAdded      = DateTime.Now;

            empUI.AddToStock(1, "Pen", 50, 720, dateAdded);
            Assert.AreEqual(dateAdded, transactoinMgr.Transaction[0].DateAdded);
        }