public void AddApprovedRequestTest()
        {
            WarehouseManager target = new WarehouseManager();
            Hypermarket_Admin_Management_Tool._1_Model.DBManager DBController = Hypermarket_Admin_Management_Tool._1_Model.DBManager.getInstance();
            string productName = "Money Clip";
            string manufacturerName = "Zooper Dooper";
            string productID = "11521340";
            string shopID = "0009";
            string shopCountry = "Middlesex";
            string shopLocation = "286 State St, 8861";
            DateTime requestDate = Convert.ToDateTime("2013-9-1");
            DateTime approvedDate = Convert.ToDateTime("2013-9-2");
            string staffID = "*****@*****.**";
            string quantity = "100";
            bool urgency = false;
            //target.AddApprovedRequest(productName, manufacturerName, productID, shopID, shopCountry, shopLocation, requestDate, approvedDate, staffID, quantity, urgency);
            DataTable actualTable = DBController.FetchApprovedRequest();
            DataTable expectedTable = setupApprovedStockExpectedTable();
            expectedTable.Rows.Add(productName, manufacturerName, productID, shopID, shopCountry, shopLocation, requestDate, approvedDate, staffID, quantity, urgency);
            DataRow actualRow = actualTable.Rows[actualTable.Rows.Count - 1];
            DataRow expectedRow = expectedTable.Rows[expectedTable.Rows.Count - 1];

            Assert.AreEqual(expectedRow["ProductName"].ToString(), actualRow["ProductName"].ToString());
            Assert.AreEqual(expectedRow["ManufacturerName"].ToString(), actualRow["ManufacturerName"].ToString());
            Assert.AreEqual(expectedRow["ProductID"].ToString(), actualRow["ProductID"].ToString());
            Assert.AreEqual(expectedRow["ShopID"].ToString(), actualRow["ShopID"].ToString());
            Assert.AreEqual(expectedRow["ShopCountry"].ToString(), actualRow["ShopCountry"].ToString());
            Assert.AreEqual(expectedRow["ShopLocation"].ToString(), actualRow["ShopLocation"].ToString());
            Assert.AreEqual(expectedRow["RequestDate"].ToString(), actualRow["RequestDate"].ToString());
            Assert.AreEqual(expectedRow["ApprovedDate"].ToString(), actualRow["ApprovedDate"].ToString());
            Assert.AreEqual(expectedRow["StaffID"].ToString(), actualRow["StaffID"].ToString());
            Assert.AreEqual(expectedRow["Quantity"].ToString(), actualRow["Quantity"].ToString());
            Assert.AreEqual(expectedRow["Urgency"].ToString(), actualRow["Urgency"].ToString());
        }
 public void WarehouseManagerConstructorTest()
 {
     WarehouseManager target = new WarehouseManager();
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
 public void FetchStockTest()
 {
     WarehouseManager target = new WarehouseManager(); // TODO: Initialize to an appropriate value
     Hypermarket_Admin_Management_Tool._1_Model.DBManager DBController = Hypermarket_Admin_Management_Tool._1_Model.DBManager.getInstance();
     DataTable expected = DBController.FetchStock();
     DataTable actual;
     actual = target.FetchStock();
     Assert.AreEqual(expected, actual);
 }
        public void UpdateStockTest()
        {
            WarehouseManager target = new WarehouseManager(); // TODO: Initialize to an appropriate value
            Hypermarket_Admin_Management_Tool._1_Model.DBManager DBController = Hypermarket_Admin_Management_Tool._1_Model.DBManager.getInstance();
            string prodcutName = "Money Clip"; // TODO: Initialize to an appropriate value
            string manufacturerName = "Zooper Dooper"; // TODO: Initialize to an appropriate value
            string productID = "11521340"; // TODO: Initialize to an appropriate value
            DateTime batchID = Convert.ToDateTime("2013-08-29"); // TODO: Initialize to an appropriate value
            string importPrice = "99"; // TODO: Initialize to an appropriate value
            string sellPrice = "15"; // TODO: Initialize to an appropriate value
            DateTime expireDate = Convert.ToDateTime("2015-08-29"); // TODO: Initialize to an appropriate value
            string quantity = "1000"; // TODO: Initialize to an appropriate value
            target.UpdateStock(productID, batchID, importPrice, sellPrice, expireDate, quantity);
            DataTable actualTable = DBController.FetchStock();
            DataTable expectedTable = setupStockExpectedTable();
            expectedTable.Rows.Add(prodcutName, manufacturerName, productID, batchID, importPrice, sellPrice, expireDate, quantity);
            DataRow actualRow = actualTable.Select("ProductID = '11521340' AND batchID = '2013-08-29'")[0];
            DataRow expectedRow = expectedTable.Rows[expectedTable.Rows.Count - 1];

            Assert.AreEqual(expectedRow["ProductName"].ToString(), actualRow["ProductName"].ToString());
            Assert.AreEqual(expectedRow["ManufacturerName"].ToString(), actualRow["ManufacturerName"].ToString());
            Assert.AreEqual(expectedRow["ProductID"].ToString(), actualRow["ProductID"].ToString());
            Assert.AreEqual(expectedRow["BatchID"].ToString(), actualRow["BatchID"].ToString());
            Assert.AreEqual(expectedRow["ImportPrice"].ToString(), actualRow["ImportPrice"].ToString());
            Assert.AreEqual(expectedRow["SellPrice"].ToString(), actualRow["SellPrice"].ToString());
            Assert.AreEqual(expectedRow["ExpireDate"].ToString(), actualRow["ExpireDate"].ToString());
            Assert.AreEqual(expectedRow["Quantity"].ToString(), actualRow["Quantity"].ToString());
        }
 public void FetchSendStockTest()
 {
     WarehouseManager target = new WarehouseManager(); // TODO: Initialize to an appropriate value
     DataTable expected = null; // TODO: Initialize to an appropriate value
     DataTable actual;
     actual = target.FetchSendStock();
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
 public void DeleteSendStockTest()
 {
     WarehouseManager target = new WarehouseManager(); // TODO: Initialize to an appropriate value
     string productID = string.Empty; // TODO: Initialize to an appropriate value
     DateTime batchID = new DateTime(); // TODO: Initialize to an appropriate value
     string shopID = string.Empty; // TODO: Initialize to an appropriate value
     target.DeleteSendStock(productID, batchID, shopID);
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
 public void DeleteRejectedRequestTest()
 {
     WarehouseManager target = new WarehouseManager(); // TODO: Initialize to an appropriate value
     string productID = string.Empty; // TODO: Initialize to an appropriate value
     string shopID = string.Empty; // TODO: Initialize to an appropriate value
     DateTime requestDate = new DateTime(); // TODO: Initialize to an appropriate value
     string staffID = string.Empty; // TODO: Initialize to an appropriate value
     target.DeleteRejectedRequest(productID, shopID, requestDate, staffID);
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
 public void ChangeRequestStatusTest()
 {
     WarehouseManager target = new WarehouseManager(); // TODO: Initialize to an appropriate value
        // bool approved = false; // TODO: Initialize to an appropriate value
     string productName = string.Empty; // TODO: Initialize to an appropriate value
     string manufacturerName = string.Empty; // TODO: Initialize to an appropriate value
     string productID = string.Empty; // TODO: Initialize to an appropriate value
     string shopID = string.Empty; // TODO: Initialize to an appropriate value
     string shopCountry = string.Empty; // TODO: Initialize to an appropriate value
     string shopLocaton = string.Empty; // TODO: Initialize to an appropriate value
       //  DateTime requestDate = new DateTime(); // TODO: Initialize to an appropriate value
      //   DateTime approvedDate = new DateTime(); // TODO: Initialize to an appropriate value
       //  DateTime rejectedDate = new DateTime(); // TODO: Initialize to an appropriate value
     string staffID = string.Empty; // TODO: Initialize to an appropriate value
     string quantity = string.Empty; // TODO: Initialize to an appropriate value
       //  bool urgency = false; // TODO: Initialize to an appropriate value
     //target.ChangeRequestStatus(approved, productName, manufacturerName, productID, shopID, shopCountry, shopLocaton, requestDate, approvedDate, rejectedDate, staffID, quantity, urgency);
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
 public void AddSendStockTest()
 {
     WarehouseManager target = new WarehouseManager(); // TODO: Initialize to an appropriate value
     string productName = string.Empty; // TODO: Initialize to an appropriate value
     string manufacturerName = string.Empty; // TODO: Initialize to an appropriate value
     string productID = string.Empty; // TODO: Initialize to an appropriate value
        // DateTime batchID = new DateTime(); // TODO: Initialize to an appropriate value
     string shopID = string.Empty; // TODO: Initialize to an appropriate value
     string shopCountry = string.Empty; // TODO: Initialize to an appropriate value
     string shopLocation = string.Empty; // TODO: Initialize to an appropriate value
        // DateTime sendDate = new DateTime(); // TODO: Initialize to an appropriate value
     string quantity = string.Empty; // TODO: Initialize to an appropriate value
        // bool deliveryStatus = false; // TODO: Initialize to an appropriate value
     //target.AddSendStock(productName, manufacturerName, productID, batchID, shopID, shopCountry, shopLocation, sendDate, quantity, deliveryStatus);
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }