Beispiel #1
0
 public OrderServices(ICustomerServices customerServices, IPizzaServices pizzaServices, HungryPizzaContext context, IMapper mapper)
 {
     _customerServices = customerServices;
     _pizzaServices    = pizzaServices;
     _context          = context;
     _mapper           = mapper;
 }
Beispiel #2
0
        public BaseTestController()
        {
            string curDir = Directory.GetCurrentDirectory();

            builder = new ConfigurationBuilder()
                      .SetBasePath(curDir)
                      .AddJsonFile("appsettings.json");

            optionsBuilder = new DbContextOptionsBuilder <HungryPizzaContext>()
                             .UseSqlServer(builder.Build().GetConnectionString("DefaultConnection")).Options;

            context = new HungryPizzaContext(optionsBuilder);

            var mockMapper = new MapperConfiguration(cfg =>
            {
                cfg.AddProfile(new AutoMapper());
            });

            mapper = mockMapper.CreateMapper();
        }
Beispiel #3
0
 public CustomerServices(HungryPizzaContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }