Пример #1
0
 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 RoutesControllerTests()
        {
            var dbOptions = new DbContextOptionsBuilder <EFDbContext>()
                            .UseInMemoryDatabase(databaseName: "WebApiNinjectStudioDbInMemory")
                            .Options;
            var context = new EFDbContext(dbOptions);

            context.Database.EnsureCreated();

            this._EFRouteRepository        = new EFRouteRepository(context);
            this._EFBusStopRepository      = new EFBusStopRepository(context);
            this._EFRouteBusStopRepository = new EFRouteBusStopRepository(context);
            this._EFRouteBusRepository     = new EFRouteBusRepository(context);

            this._MockMapper = new MapperConfiguration(cfg => cfg.AddProfile(new AutoMapperProfile()))
                               .CreateMapper();
        }