public IEnumerable <AirportViewModel> GetAll() { var allAirports = _airportService.GetAll(); var result = _mapper.Map <IEnumerable <AirportViewModel> >(allAirports); return(result); }
public void GetAllTestFixture() { //Create a mock object of a Flight class var mockAirport = new Mock <IAirport>(); //Configure dummy method so that it return true when it gets any string as parameters to the method mockAirport.Setup(r => r.GetAll()).Returns(new List <Airport>()); IAirport airportServices = new AirportService(_unitOfWork); var result = airportServices.GetAll(); //Verify the result is what is expected Assert.IsTrue(result.Count > 0); //Verify that our mock has been called mockAirport.Verify(m => m.GetAll()); }
public IEnumerable <DepartureDTO> Get() { return(Mapper.Map <IEnumerable <Departure>, IEnumerable <DepartureDTO> >(_service.GetAll <Departure>())); }
public async Task <IEnumerable <PlaneTypeDTO> > Get() { return(Mapper.Map <IEnumerable <PlaneType>, IEnumerable <PlaneTypeDTO> >(await _service.GetAll <PlaneType>())); }
public IEnumerable <CrewDTO> Get() { return(Mapper.Map <IEnumerable <Crew>, IEnumerable <CrewDTO> >(_service.GetAll <Crew>())); }
public IEnumerable <PlaneDTO> Get() { return(Mapper.Map <IEnumerable <Plane>, IEnumerable <PlaneDTO> >(_service.GetAll <Plane>())); }
public IEnumerable <StewardessDTO> Get() { return(Mapper.Map <IEnumerable <Stewardess>, IEnumerable <StewardessDTO> >(_service.GetAll <Stewardess>())); }
public async Task <IEnumerable <CrewDTO> > Get() { return(_mapper.Map <IEnumerable <Crew>, IEnumerable <CrewDTO> >(await _service.GetAll <Crew>())); }
public IEnumerable <FlightDTO> Get() { return(Mapper.Map <IEnumerable <Flight>, IEnumerable <FlightDTO> >(_service.GetAll <Flight>())); }
public IEnumerable <TicketDTO> Get() { return(Mapper.Map <IEnumerable <Ticket>, IEnumerable <TicketDTO> >(_service.GetAll <Ticket>())); }
public async Task <IEnumerable <FlightDTO> > Get() { return(_mapper.Map <IEnumerable <Flight>, IEnumerable <FlightDTO> >(await _service.GetAll <Flight>())); }
public async Task <IEnumerable <StewardessDTO> > Get() { return(Mapper.Map <IEnumerable <Stewardess>, IEnumerable <StewardessDTO> >(await _service.GetAll <Stewardess>())); }
public async Task <IEnumerable <PilotDTO> > Get() { return(Mapper.Map <IEnumerable <Pilot>, IEnumerable <PilotDTO> >(await _service.GetAll <Pilot>())); }
public void CreateGetPilot_when_create_pilot_then_get_pilot_correct() { Pilot pilot = new Pilot() { Name = "name", Surname = "surname", Experience = 5 }; _airportService.Post(pilot); _airportService.SaveChanges(); var newPilot = _airportService.GetAll <Pilot>().Last(); Assert.AreEqual(pilot.Name, newPilot.Name); Assert.AreEqual(pilot.Surname, newPilot.Surname); Assert.AreEqual(pilot.Experience, newPilot.Experience); }
public async Task <IEnumerable <DepartureDTO> > Get() { return(Mapper.Map <IEnumerable <Departure>, IEnumerable <DepartureDTO> >(await _service.GetAll <Departure>())); }