public void Initialize() { var options = new DbContextOptionsBuilder <Hesabdar.Models.HesabdarContext>() .UseInMemoryDatabase(databaseName: "Add_writes_to_database") .Options; context = new Hesabdar.Models.HesabdarContext(options); this.controller = new MaterialController(context); }
public async Task InitializeAsync() { var db = new DbContextOptionsBuilder <HesabdarContext>() .UseInMemoryDatabase(databaseName: "test", new InMemoryDatabaseRoot()); context = new HesabdarContext(db.Options); context.Database.EnsureCreated(); this.sut = new DealerController(context); await TestDataGenerator.GenerateSeedDealersAsync(sut); }
public async Task InitializeAsync() { var db = new DbContextOptionsBuilder <HesabdarContext>() .UseInMemoryDatabase(databaseName: "test", new InMemoryDatabaseRoot()); context = new HesabdarContext(db.Options); context.Database.EnsureCreated(); materialController = new MaterialController(context); dealerController = new DealerController(context); sut = new DealController(context); await TestDataGenerator.GenerateSeedMaterialAsync(materialController); await TestDataGenerator.GenerateSeedDealersAsync(dealerController); var materials = materialController.GetMaterials(1, Int32.MaxValue).GetObject <PagedResult <Material> >().Queryable.ToList(); var dealers = dealerController.Dealers(1, Int32.MaxValue).GetObject <PagedResult <Dealer> >().Queryable.ToList(); await TestDataGenerator.GenerateSeedDealAsync(sut, dealers, materials); }
public DealController(HesabdarContext context) { _context = context; }
public void Cleanup() { context = null; }
public PaymentController(HesabdarContext context) { _context = context; }
public StatisticsController(HesabdarContext context) { _context = context; }
public ActivityController(UserManager <IdentityUser> userManager, HesabdarContext context) { _context = context; this.userManager = userManager; }
public MaterialController(HesabdarContext context) { _context = context; }