public void WorkerCreateCarValidationFailTest() { var serviceMock = new Mock<ICarDTOService>(); var serviceMock2 = new Mock<IStationDTOService>(); WorkerController controller = new WorkerController(serviceMock.Object, serviceMock2.Object); var result = controller.CreateCar(new CarDTO()); Assert.IsTrue(result.Contains(Messages.ErrorOccured)); }
public void WorkerIndexNaiveTest() { var serviceMock = new Mock<ICarDTOService>(); var serviceMock2 = new Mock<IStationDTOService>(); WorkerController controller = new WorkerController(serviceMock.Object, serviceMock2.Object); var result = controller.Index(); Assert.IsInstanceOfType(result,typeof(ViewResult)); }
public void GetStationCarsTest() { var serviceMock = new Mock<ICarDTOService>(); var serviceMock2 = new Mock<IStationDTOService>(); List<StationDTO> l=new List<StationDTO>(); serviceMock2.Setup(s => s.Get()).ReturnsAsync(l); WorkerController controller = new WorkerController(serviceMock.Object, serviceMock2.Object); var stations = controller.GetStationCars(); Assert.IsInstanceOfType(stations, typeof(JsonResult)); }
public void GetCarGridTest() { var serviceMock = new Mock<ICarDTOService>(); var serviceMock2 = new Mock<IStationDTOService>(); List<CarDTO> l=new List<CarDTO>() { new CarDTO() }; serviceMock.Setup(s => s.Get()).ReturnsAsync(l); WorkerController controller=new WorkerController(serviceMock.Object,serviceMock2.Object); var cars =controller.GetCars("", "", 1, 1); Assert.IsInstanceOfType(cars,typeof(JsonResult)); }
public void GetFrenchCarTest() { var serviceMock = new Mock<ICarDTOService>(); var serviceMock2 = new Mock<IStationDTOService>(); WorkerController controller = new WorkerController(serviceMock.Object, serviceMock2.Object); var result = controller.GetFrenchCars(); Assert.IsInstanceOfType(result,typeof(JsonResult)); }