Exemplo n.º 1
0
        public void DeleteFlight_Valid_OkRequest()
        {
            var mock             = new Mock <EFFlightRepository>(db);//repos
            FlightController obj = new FlightController(mock.Object);
            var data             = obj.Delete(1);

            Assert.IsNotNull(data);
        }
Exemplo n.º 2
0
 public void DeleteFlight_InValid_BadRequest()
 {
     try
     {
         var mock             = new Mock <EFFlightRepository>(db);//repos
         FlightController obj = new FlightController(mock.Object);
         var data             = obj.Delete(0);
         var res = data as OkObjectResult;
         Assert.AreEqual(400, res.StatusCode);
     }
     catch (Exception e)
     {
         Assert.AreEqual("Object reference not set to an instance of an object.", e.Message);
     }
 }