예제 #1
0
        public BaseTest()
        {
            DbContextOptionsBuilder <OrderDatabaseContext> orderBuilder = new DbContextOptionsBuilder <OrderDatabaseContext>();
            var connectionString = "server=localhost;userid=root;password=123456;database=Product;";

            orderBuilder.UseMySql(connectionString);
            //.UseInternalServiceProvider(serviceProvider); //burası postgress ile sıkıntı çıkartmıyor, fakat mysql'de çalışmıyor test esnasında hata veriyor.

            _orderDatabaseContext = new OrderDatabaseContext(orderBuilder.Options);
            //_context.Database.Migrate();

            //Configuration
            iHttpContextAccessor = new HttpContextAccessor {
                HttpContext = new DefaultHttpContext()
            };
            _orderSettings = Options.Create(new OrderSettings()
            {
                FileUploadFolderPath = @"C:\Users\haltunbas\Documents\GitHub\ProductV2\Product.Api\Product.Api\wwwroot\upload\"
            });

            _orderService        = new OrderService(_orderDatabaseContext, _orderSettings, iHttpContextAccessor);
            _orderItemService    = new OrderItemService(_orderDatabaseContext, _orderSettings, iHttpContextAccessor);
            orderSchemaService   = new OrderSchemaService(_orderDatabaseContext, _orderSettings, iHttpContextAccessor);
            _orderAddressService = new OrderAddressService(_orderDatabaseContext, _orderSettings, iHttpContextAccessor);
        }
예제 #2
0
 public AddOrderWithOutUserHandler(
     IUnitOfWork uow,
     IOrderService orderService,
     IOrderItemService orderItemService,
     IProductService productService,
     IAddressService addressService,
     IOrderAddressService orderaddressService
     )
 {
     _uow                 = uow;
     _orderService        = orderService;
     _orderItemService    = orderItemService;
     _productService      = productService;
     _addressService      = addressService;
     _orderaddressService = orderaddressService;
 }