public RunningBussesController(RouteBusFactory routeBusFactory, INumberOfPassengerRepository numberOfPassengerRepository, IMapper mapper) { this._RouteBusRepository = routeBusFactory(RouteBusRepositoryType.EF); this._RedisRouteBusRepository = routeBusFactory(RouteBusRepositoryType.Redis); this._NumberOfPassengerRepository = numberOfPassengerRepository; this._Mapper = mapper; }
public RoutesController(IRouteRepository routeRepository, IRouteBusStopRepository routeBusStopRepository, IBusStopRepository busStopRepository, IRouteBusRepository routeBusRepository, IMapper mapper) { this._RouteRepository = routeRepository; this._RouteBusStopRepository = routeBusStopRepository; this._RouteBusRepository = routeBusRepository; this._BusStopRepository = busStopRepository; this._Mapper = mapper; }
public BusStopsControllerTests() { var dbOptions = new DbContextOptionsBuilder <EFDbContext>() .UseInMemoryDatabase(databaseName: "WebApiNinjectStudioDbInMemory") .Options; var context = new EFDbContext(dbOptions); context.Database.EnsureCreated(); this._EFRouteBusRepository = new EFRouteBusRepository(context); this._EFBusStopRepository = new EFBusStopRepository(context); this._MockMapper = new MapperConfiguration(cfg => cfg.AddProfile(new AutoMapperProfile())) .CreateMapper(); }