public void TestAddNewCrop()
        {
            DbConnecter dbC  = new DbConnecter();
            string      resp = dbC.connect();

            Assert.AreEqual("Done", resp);

            Crop aCrop = new Crop();

            aCrop.Name        = "Banana";
            aCrop.Quantity    = 40;
            aCrop.GrowthStage = "A";

            CropHandler cropHand = new CropHandler();
            int         resp2    = cropHand.addNewCrop(dbC.getConn(), aCrop);

            Assert.AreEqual(1, resp2);
        }
예제 #2
0
        public void TestAddNewLabourer()
        {
            DbConnecter dbC  = new DbConnecter();
            string      resp = dbC.connect();

            Assert.AreEqual("Done", resp);

            Labourer labrA = new Labourer();

            labrA.Name   = "Bob";
            labrA.Age    = 39;
            labrA.Gender = "male";

            LabourerHandler labrHand = new LabourerHandler();
            int             resp2    = labrHand.addNewLabourer(dbC.getConn(), labrA);

            Assert.IsNotNull(resp2);
        }
예제 #3
0
        public void TestAddNewStock()
        {
            DbConnecter dbC  = new DbConnecter();
            string      resp = dbC.connect();

            Assert.AreEqual("Done", resp);

            Stock aStock = new Stock();

            aStock.Type         = 2;
            aStock.Quantity     = 99;
            aStock.SupplierId   = 4;
            aStock.PurchaseDate = new DateTime(2018, 10, 25, 0, 0, 0);
            aStock.ExpiryDate   = new DateTime(2019, 1, 24, 0, 0, 0);

            StockHandler labrHand = new StockHandler();
            int          resp2    = labrHand.addNewStock(dbC.getConn(), aStock);

            Assert.IsNotNull(resp2);
        }
예제 #4
0
 private void Start()
 {
     instance = this;
     //Screen.SetResolution(540, 960,true);
     //SQLConnection();
 }