Ejemplo n.º 1
0
        public void Setup()
        {
            db                  = SetDatabaseContext();
            _mapper             = SetAutomapper();
            operatorCityService = new OperatorCityService(_mapper, db);

            Seed(db);
        }
Ejemplo n.º 2
0
        public void Setup()
        {
            if (mapper == null)
            {
                var mappingConfig = new MapperConfiguration(mc =>
                {
                    mc.AddProfile(new AutomapperProfile());
                });
                IMapper mapper = mappingConfig.CreateMapper();
                this.mapper = mapper;
            }

            var dbContextOptions = new DbContextOptionsBuilder <DatabaseContext>()
                                   .UseInMemoryDatabase(Guid.NewGuid().ToString())
                                   .Options;

            db = new DatabaseContext(dbContextOptions);
            operatorCityService    = new OperatorCityService(mapper, db);
            operatorCityController = new OperatorCityController(operatorCityService);
            Seed(db);
        }
Ejemplo n.º 3
0
 public OperatorCityController(OperatorCityService operatorCityService)
 {
     OperatorCityService = operatorCityService;
 }