public static void DeleteAirportTest(IAirportService airportService, string name) { airportService.DeleteAirport(new Domain.BO.Airport.AirportDTO() { Name = name }); }
public void Teardown() { mockRepository = null; mockUow = null; mockEventListener = null; airportService = null; }
public ShowAllAirportsViewModel(IAirportService airportService, IUserDialogService dialogService) { _airportService = airportService; _dialogService = dialogService; Airports = new ObservableCollection <AirportModel>(); UpdateAirports(); }
public AirportController(ILogger <AirportController> logger, IMapper mapper, IUnitOfWork unitOfWork , IAirportService airportService ) : base(logger, mapper, unitOfWork) { _airportService = airportService ?? throw new ArgumentNullException(nameof(airportService)); }
/// <summary> /// Constructor injects all dependencies /// </summary> /// <param name="logger">ILogger Interface for logging purposes</param> /// <param name="FlightService">Interface for Flight Service (Service-Repository Pattern)</param> /// <param name="AirportService">Interface for Airport Service (Service-Repository Pattern)</param> public FlightController(ILogger <FlightController> logger, IFlightService FlightService, IAirportService AirportService) { _airportService = AirportService; _flightService = FlightService; _logger = logger; }
public FlightBusiness(IFlightService flightService, IAircraftService aircraftService, IAirportService airportService) { _flightService = flightService; _aircraftService = aircraftService; _airportService = airportService; }
public void Setup() { mockRepository = new Mock <IRepository <Airport> >(); mockUow = new Mock <IUnitOfWork>(); mockEventListener = new Mock <IEventListener>(); mockUow.Setup(m => m.AirportRepository).Returns(mockRepository.Object); airportService = new AirportService(mockUow.Object, mockEventListener.Object); }
public HomeController(IAirportService airportService, ISeatClassService seatClassService, ICountryService countryService, IPassengerTypeService passengerTypeService) { this.AirportService = airportService; this.SeatClassService = seatClassService; this.CountryService = countryService; this.PassengerTypeService = passengerTypeService; }
public AirportController( IAirportService airportService, ILogger <AirportController> logger ) { _airportService = airportService; _logger = logger; }
public void Intialize() { _airportService = Substitute.For <IAirportService>(); _flightService = Substitute.For <IFlightService>(); airportsController = new AirportsController(_airportService); flightsController = new FlightsController(_flightService, _airportService); }
public AirportDistanceQueryHandler(IAirportService airportService) { if (airportService == null) { throw new ArgumentNullException(nameof(airportService)); } this.airportService = airportService; }
public TicketController(ITicketService ticketService, IFlightService flightService, IPassengerTicketService passengerTicketService, IAirportService airportService, ISeatMapService seatMapService, ITicketFlightService ticketFlightService) { this.TicketService = ticketService; this.FlightService = flightService; this.AirportService = airportService; this.SeatMapService = seatMapService; this.TicketFlightService = ticketFlightService; this.PassengerTicketService = passengerTicketService; }
public GenerateDataController(IAirportService airportService, ISeatClassService seatClassService, IPlaneService planeService, IPlaneSeatClassService planeSeatClassService, IPlaneAirportService planeAirportService, IFlightService flightService) { this.AirportService = airportService; this.SeatClassService = seatClassService; this.PlaneService = planeService; this.PlaneAirportService = planeAirportService; this.PlaneSeatClassService = planeSeatClassService; this.FlightService = flightService; }
public FlightController(IAirportService airportService, ISeatClassService seatClassService, IFlightService flightService, ICountryService countryService, IPassengerTypeService passengerTypeService, ISeatMapService seatMapService) { this.AirportService = airportService; this.SeatClassService = seatClassService; this.FlightService = flightService; this.CountryService = countryService; this.PassengerTypeService = passengerTypeService; this.SeatMapService = seatMapService; }
public WindowsUserDialogService(IRouteService routeService, IFlightService flightService, IAirplaneService airplaneService, IAirportService airportService, IPassengerService passengerService, ITicketService ticketService, ICarrierService carrierService) { _routeService = routeService; _flightService = flightService; _airplaneService = airplaneService; _airportService = airportService; _passengerService = passengerService; _ticketService = ticketService; _carrierService = carrierService; }
public Airport VName(Airport airport, IAirportService _airportService) { if (String.IsNullOrEmpty(airport.Name) || airport.Name.Trim() == "") { airport.Errors.Add("Name", "Tidak boleh kosong"); } else if (_airportService.IsNameDuplicated(airport)) { airport.Errors.Add("Name", "Tidak boleh diduplikasi"); } return(airport); }
public ClassifiersController(IAirportService airportService, IAirportSchemeService airportSchemeService, ICityService cityService, ICountryService countryService, IGateService gateService, IFlightService flightService, IPlaneService planeService, ITerminalService terminalService, ITimeTableService timeTableService) { _airportService = airportService; _airportSchemeService = airportSchemeService; _cityService = cityService; _countryService = countryService; _gateService = gateService; _flightService = flightService; _planeService = planeService; _terminalService = terminalService; _timeTableService = timeTableService; }
public Airport VObject(Airport airport, IAirportService _airportService) { Airport oldairport = _airportService.GetObjectById(airport.Id); if (oldairport == null) { airport.Errors.Add("Generic", "Invalid Data For Update"); } else if (!VOffice(airport.OfficeId, oldairport.OfficeId)) { airport.Errors.Add("Generic", "Invalid Data For Update"); } return(airport); }
public AirportServiceTests() { MapperConfiguration mappingConfig = new MapperConfiguration(config => { config.CreateMap <Airport, AirportEntity>(); config.CreateMap <AirportEntity, Airport>(); }); mappingConfig.CompileMappings(); IMapper mapper = mappingConfig.CreateMapper(); _airportService = new AirportService(new AirportRepositoryMock(), mapper); }
/// <summary> /// Initializes a new instance of the <see cref="AirportController" /> class. /// </summary> /// <param name="airportService">The airport service.</param> /// <param name="logger">The logger.</param> /// <exception cref="System.ArgumentNullException"> /// </exception> public AirportController(IAirportService airportService, ILoggingService logger) { if (airportService == null) { throw new ArgumentNullException(nameof(airportService)); } if (logger == null) { throw new ArgumentNullException(nameof(logger)); } _airportService = airportService; _logger = logger; }
public void Service() { _airportService = new AirportService(_airportRepository, new AirportSchemeRepository(_dbFactory), new CityService(_cityRepository, _unitOfWork), _unitOfWork); _cityService = new CityService(_cityRepository, _unitOfWork); var airportOld = _airportService.GetAirport(16); var city = _cityService.GetCity(8); Console.WriteLine(airportOld.Name + " - " + airportOld.City.Name); _airportService.UpdateAirport(airportOld); var airportNew = _airportService.GetAirport(16); Console.WriteLine(airportNew.Name + " - " + airportNew.City.Name); Console.ReadKey(); }
public Airport VCreateObject(Airport airport, IAirportService _airportService, ICityLocationService _citylocationservice) { VName(airport, _airportService); if (!isValid(airport)) { return(airport); } VAbbrevation(airport); if (!isValid(airport)) { return(airport); } VCityLocation(airport, _citylocationservice); if (!isValid(airport)) { return(airport); } return(airport); }
public void Intialize() { _appContext = Substitute.For <ApplicationContext>(); var airportlogger = Substitute.For <ILogger <AirportService> >(); var flightlogger = Substitute.For <ILogger <FlightService> >(); IQueryable <Airport> airports = new List <Airport> { new Airport { Id = 1, Name = "Paris Orly" }, }.AsQueryable(); IQueryable <Flight> flights = new List <Flight> { new Flight { Id = 1, Name = "Paris Orly-Casblanca" }, }.AsQueryable(); DbSet <Airport> airportMockSet = Substitute.For <DbSet <Airport>, IQueryable <Airport> >(); ((IQueryable <Airport>)airportMockSet).Provider.ReturnsForAnyArgs(airports.Provider); ((IQueryable <Airport>)airportMockSet).Expression.ReturnsForAnyArgs(airports.Expression); ((IQueryable <Airport>)airportMockSet).ElementType.ReturnsForAnyArgs(airports.ElementType); ((IQueryable <Airport>)airportMockSet).GetEnumerator().ReturnsForAnyArgs(airports.GetEnumerator()); DbSet <Flight> flightMockSet = Substitute.For <DbSet <Flight>, IQueryable <Flight> >(); ((IQueryable <Flight>)flightMockSet).Provider.ReturnsForAnyArgs(flights.Provider); ((IQueryable <Flight>)flightMockSet).Expression.ReturnsForAnyArgs(flights.Expression); ((IQueryable <Flight>)flightMockSet).ElementType.ReturnsForAnyArgs(flights.ElementType); ((IQueryable <Flight>)flightMockSet).GetEnumerator().ReturnsForAnyArgs(flights.GetEnumerator()); _appContext.Airport = airportMockSet; _appContext.Flight = flightMockSet; _airportService = new AirportService(_appContext, airportlogger); _flightService = new FlightService(_appContext, flightlogger); }
public CommonController(IMappingService mappingService, ICityService cityService, IAirportService airportService) { if (mappingService == null) { throw new NullReferenceException("MappingService"); } if (cityService == null) { throw new NullReferenceException("CityService"); } if (airportService == null) { throw new NullReferenceException("AirportService"); } this.cityService = cityService; this.mappingService = mappingService; this.airportService = airportService; }
public AirportController(IAirportService airportService, ICountryService countryService) { this.AirportService = airportService; this.CountryService = countryService; }
public AirportsController(IAirportService airportService, IMapper mapper) { _airportService = airportService; _mapper = mapper; }
public AdminController(IFlightService flightService, IAirportService airportService, IMapper mapper) : base(flightService, airportService, mapper) { }
public AirportController(IAirportService airportService) { _airportService = airportService; }
public AirportController() { _airportService = new AirportService(); }
public SearchController(IAirportService aps, ICurrencyService cs, IFlightService fs) { this.aps = aps; this.cs = cs; this.fs = fs; }