Esempio n. 1
0
        public async Task Update_WhenTicketNull_ThenReturnExeption()
        {
            var Tickets = new IFakeRepository <Ticket>();
            var context = new IFakeUnitOfFactory();

            TicketDto TicketDto = null;

            TicketService service        = new TicketService(context);
            TicketDto     TicketDtoSaved = await service.Update(TicketDto);
        }
Esempio n. 2
0
        public async Task Update_WhenPilotNull_ThenReturnExeption()
        {
            var Pilots  = new IFakeRepository <Pilot>();
            var context = new IFakeUnitOfFactory();

            PilotDto PilotDto = null;

            PilotService service       = new PilotService(context);
            PilotDto     PilotDtoSaved = await service.Update(PilotDto);
        }
Esempio n. 3
0
        public async Task Update_WhenCrewNull_ThenReturnExeption()
        {
            var Crews   = new IFakeRepository <Crew>();
            var context = new IFakeUnitOfFactory();

            CrewDto CrewDto = null;

            CrewService service      = new CrewService(context);
            CrewDto     CrewDtoSaved = await service.Update(CrewDto);
        }
Esempio n. 4
0
        public async Task Update_WhenStewardessNull_ThenReturnExeption()
        {
            var Stewardesss = new IFakeRepository <Stewardess>();
            var context     = new IFakeUnitOfFactory();

            StewardessDto StewardessDto = null;

            StewardessService service            = new StewardessService(context);
            StewardessDto     StewardessDtoSaved = await service.Update(StewardessDto);
        }
        public async Task Update_WhenFlightNull_ThenReturnExeption()
        {
            var Flights = new IFakeRepository <Flight>();
            var context = new IFakeUnitOfFactory();

            FlightDto FlightDto = null;

            FlightService service        = new FlightService(context);
            FlightDto     FlightDtoSaved = await service.Update(FlightDto);
        }
        public async Task Update_WhenTypeAircraftNull_ThenReturnExeption()
        {
            var TypeAircrafts = new IFakeRepository <TypeAircraft>();
            var context       = new IFakeUnitOfFactory();

            TypeAircraftDto TypeAircraftDto = null;

            TypeAircraftService service = new TypeAircraftService(context);
            TypeAircraftDto     TypeAircraftDtoSaved = await service.Update(TypeAircraftDto);
        }
Esempio n. 7
0
        public async Task Create_WhenAircraftNull_ThenReturnExeption()
        {
            var aircrafts = new IFakeRepository <Aircraft>();
            var context   = new IFakeUnitOfFactory();

            AircraftDto aircraftDto = null;

            AircraftService service          = new AircraftService(context);
            AircraftDto     aircraftDtoSaved = await service.Create(aircraftDto);
        }
Esempio n. 8
0
        public async Task Update_WhenValidPilot_ThenReturnPilot()
        {
            var Pilots  = new IFakeRepository <Pilot>();
            var context = new IFakeUnitOfFactory();

            PilotDto PilotDto = new PilotDto()
            {
                Id   = 154,
                Name = "Nataly"
            };

            PilotService service       = new PilotService(context);
            PilotDto     PilotDtoSaved = await service.Update(PilotDto);

            Assert.AreEqual(PilotDto.Name, PilotDtoSaved.Name);
            Assert.AreEqual(PilotDto.Id, PilotDtoSaved.Id);
        }
Esempio n. 9
0
        public async Task Update_WhenValidCrew_ThenReturnCrew()
        {
            var Crews   = new IFakeRepository <Crew>();
            var context = new IFakeUnitOfFactory();

            CrewDto CrewDto = new CrewDto()
            {
                Id      = 154,
                PilotId = 5,
            };

            CrewService service      = new CrewService(context);
            CrewDto     CrewDtoSaved = await service.Update(CrewDto);

            Assert.AreEqual(CrewDto.PilotId, CrewDtoSaved.PilotId);
            Assert.AreEqual(CrewDto.Id, CrewDtoSaved.Id);
        }
Esempio n. 10
0
        public async Task Update_WhenValidStewardess_ThenReturnStewardess()
        {
            var Stewardesss = new IFakeRepository <Stewardess>();
            var context     = new IFakeUnitOfFactory();

            StewardessDto StewardessDto = new StewardessDto()
            {
                Id   = 154,
                Name = "Nataly"
            };

            StewardessService service            = new StewardessService(context);
            StewardessDto     StewardessDtoSaved = await service.Update(StewardessDto);

            Assert.AreEqual(StewardessDto.Name, StewardessDtoSaved.Name);
            Assert.AreEqual(StewardessDto.Id, StewardessDtoSaved.Id);
        }
        public async Task Update_WhenValidFlight_ThenReturnFlight()
        {
            var Flights = new IFakeRepository <Flight>();
            var context = new IFakeUnitOfFactory();

            FlightDto flightDto = new FlightDto()
            {
                Id           = 154,
                ArrivalPoint = "TEST",
            };

            FlightService service        = new FlightService(context);
            FlightDto     FlightDtoSaved = await service.Update(flightDto);

            Assert.AreEqual(flightDto.ArrivalPoint, FlightDtoSaved.ArrivalPoint);
            Assert.AreEqual(flightDto.Id, FlightDtoSaved.Id);
        }
Esempio n. 12
0
        public async Task Update_WhenValidTicket_ThenReturnTicket()
        {
            var Tickets = new IFakeRepository <Ticket>();
            var context = new IFakeUnitOfFactory();

            TicketDto TicketDto = new TicketDto()
            {
                Id    = 154,
                Price = 10
            };

            TicketService service        = new TicketService(context);
            TicketDto     TicketDtoSaved = await service.Update(TicketDto);

            Assert.AreEqual(TicketDto.Price, TicketDtoSaved.Price);
            Assert.AreEqual(TicketDto.Id, TicketDtoSaved.Id);
        }
        public async Task Update_WhenValidTypeAircraft_ThenReturnTypeAircraft()
        {
            var TypeAircrafts = new IFakeRepository <TypeAircraft>();
            var context       = new IFakeUnitOfFactory();

            TypeAircraftDto TypeAircraftDto = new TypeAircraftDto()
            {
                Id           = 154,
                NumberPlaces = 100
            };

            TypeAircraftService service = new TypeAircraftService(context);
            TypeAircraftDto     TypeAircraftDtoSaved = await service.Update(TypeAircraftDto);

            Assert.AreEqual(TypeAircraftDto.NumberPlaces, TypeAircraftDtoSaved.NumberPlaces);
            Assert.AreEqual(TypeAircraftDto.Id, TypeAircraftDtoSaved.Id);
        }
Esempio n. 14
0
        public async Task Update_WhenValidAircraft_ThenReturnAircraft()
        {
            var aircrafts = new IFakeRepository <Aircraft>();
            var context   = new IFakeUnitOfFactory();

            AircraftDto aircraftDto = new AircraftDto()
            {
                Id             = 154,
                AircraftName   = "Test",
                TypeAircraftId = 165
            };

            AircraftService service          = new AircraftService(context);
            AircraftDto     aircraftDtoSaved = await service.Update(aircraftDto);

            Assert.AreEqual(aircraftDto.AircraftName, aircraftDtoSaved.AircraftName);
            Assert.AreEqual(aircraftDto.Id, aircraftDtoSaved.Id);
            Assert.AreEqual(aircraftDto.TypeAircraftId, aircraftDtoSaved.TypeAircraftId);
        }