public static EarlessContext CreateContext() { EarlessContext context = new EarlessContext(CreateNewEntityFrameworkContextOptions()); context.Database.EnsureCreated(); return(context); }
public EarlessContext InitializeContext() { EarlessContext context = TestDbGenerator.CreateContext(); TestDbGenerator.Initialize(context); productCategories = GetProductCategories(false); context.AddRange(); products = GetProducts(false, productCategories); context.AddRange(products); context.SaveChanges(); return(context); }
public static void Initialize(EarlessContext context) { context.Database.EnsureCreated(); }
public ProductServiceTest() { context = mockFactory.InitializeContext(); productService = new ProductService(context); productCount = context.Products.Count(); }
public ProductService(EarlessContext context) { this.context = context; }
public OrderLineServiceTest() { context = mockFactory.InitializeContext(); orderLineService = new OrderLineService(context); orderService = new OrderService(context, orderLineService); }
public OrderLineService(EarlessContext context) { this.context = context; }
public OrderService(EarlessContext context, IOrderLineService orderLineService) { this.context = context; this.orderLineService = orderLineService; }