コード例 #1
0
        public void GetAllPotHolesTest()
        {
            PotholeDAL     sql         = new PotholeDAL(connectionString);
            List <Pothole> potholeList = sql.GetAllPotholes();

            Assert.AreEqual(potholeCount + 1, potholeList.Count);
        }
コード例 #2
0
        public void InsertPotholeTest()
        {
            PotholeDAL sql     = new PotholeDAL(connectionString);
            Pothole    pothole = new Pothole
            {
                Status       = "Reported",
                Severity     = 4,
                DateReported = DateTime.UtcNow.Date,
                Longitude    = -83.045653M,
                Latitude     = 39.99753999999996M,
            };

            Assert.AreEqual(updateId + 1, sql.InsertPothole(pothole));
        }
コード例 #3
0
        public void UpdatePotholeTest()
        {
            DateTime repair  = new DateTime(2018, 5, 30);
            DateTime inspect = new DateTime(2018, 4, 30);

            PotholeDAL sql     = new PotholeDAL(connectionString);
            Pothole    pothole = new Pothole
            {
                PotholeID   = updateId,
                Status      = "Inspected",
                Severity    = 5,
                RepairDate  = null,
                InspectDate = inspect,
            };

            Assert.AreEqual(true, sql.UpdatePothole(pothole));
        }