コード例 #1
0
        public IEnumerable <AirportViewModel> GetAll()
        {
            var allAirports = _airportService.GetAll();
            var result      = _mapper.Map <IEnumerable <AirportViewModel> >(allAirports);

            return(result);
        }
コード例 #2
0
        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());
        }
コード例 #3
0
 public IEnumerable <DepartureDTO> Get()
 {
     return(Mapper.Map <IEnumerable <Departure>, IEnumerable <DepartureDTO> >(_service.GetAll <Departure>()));
 }
コード例 #4
0
 public async Task <IEnumerable <PlaneTypeDTO> > Get()
 {
     return(Mapper.Map <IEnumerable <PlaneType>, IEnumerable <PlaneTypeDTO> >(await _service.GetAll <PlaneType>()));
 }
コード例 #5
0
 public IEnumerable <CrewDTO> Get()
 {
     return(Mapper.Map <IEnumerable <Crew>, IEnumerable <CrewDTO> >(_service.GetAll <Crew>()));
 }
コード例 #6
0
 public IEnumerable <PlaneDTO> Get()
 {
     return(Mapper.Map <IEnumerable <Plane>, IEnumerable <PlaneDTO> >(_service.GetAll <Plane>()));
 }
コード例 #7
0
 public IEnumerable <StewardessDTO> Get()
 {
     return(Mapper.Map <IEnumerable <Stewardess>, IEnumerable <StewardessDTO> >(_service.GetAll <Stewardess>()));
 }
コード例 #8
0
 public async Task <IEnumerable <CrewDTO> > Get()
 {
     return(_mapper.Map <IEnumerable <Crew>, IEnumerable <CrewDTO> >(await _service.GetAll <Crew>()));
 }
コード例 #9
0
 public IEnumerable <FlightDTO> Get()
 {
     return(Mapper.Map <IEnumerable <Flight>, IEnumerable <FlightDTO> >(_service.GetAll <Flight>()));
 }
コード例 #10
0
 public IEnumerable <TicketDTO> Get()
 {
     return(Mapper.Map <IEnumerable <Ticket>, IEnumerable <TicketDTO> >(_service.GetAll <Ticket>()));
 }
コード例 #11
0
 public async Task <IEnumerable <FlightDTO> > Get()
 {
     return(_mapper.Map <IEnumerable <Flight>, IEnumerable <FlightDTO> >(await _service.GetAll <Flight>()));
 }
コード例 #12
0
 public async Task <IEnumerable <StewardessDTO> > Get()
 {
     return(Mapper.Map <IEnumerable <Stewardess>, IEnumerable <StewardessDTO> >(await _service.GetAll <Stewardess>()));
 }
コード例 #13
0
 public async Task <IEnumerable <PilotDTO> > Get()
 {
     return(Mapper.Map <IEnumerable <Pilot>, IEnumerable <PilotDTO> >(await _service.GetAll <Pilot>()));
 }
コード例 #14
0
ファイル: DbTests.cs プロジェクト: vhuzii/Academy_Homework6
        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);
        }
コード例 #15
0
 public async Task <IEnumerable <DepartureDTO> > Get()
 {
     return(Mapper.Map <IEnumerable <Departure>, IEnumerable <DepartureDTO> >(await _service.GetAll <Departure>()));
 }