Exemple #1
0
        public void DeleteVehicleTest()
        {
            VehicleDTO expectedVehicle = CreateVehicle("TEST123");
            VehicleDAO vehicleDAO      = new VehicleDAOImpl();
            VehicleDTO resultVehicle   = vehicleDAO.FindVehicleByVin("TEST123");

            if (resultVehicle == null)
            {
                vehicleDAO.AddVehicle(expectedVehicle);
            }
            vehicleDAO.DeleteVehicleByVin("TEST123");

            resultVehicle = vehicleDAO.FindVehicleByVin("TEST123");

            Assert.IsNull(resultVehicle);
        }
Exemple #2
0
        public void UpdateVehicleTest()
        {
            VehicleDTO expectedVehicle = CreateVehicle("TEST12");
            VehicleDAO vehicleDAO      = new VehicleDAOImpl();
            VehicleDTO resultVehicle   = vehicleDAO.FindVehicleByVin("TEST12");

            if (resultVehicle == null)
            {
                vehicleDAO.AddVehicle(expectedVehicle);
            }

            expectedVehicle.Color = "Azul";

            vehicleDAO.UpdateVehicle(expectedVehicle);

            resultVehicle = vehicleDAO.FindVehicleByVin("TEST12");

            Assert.AreEqual(expectedVehicle.Color, resultVehicle.Color);

            vehicleDAO.DeleteVehicleByVin("TEST12");
        }