public async Task Setup() { var dbContextFactory = new SampleDbContextFactory(); DbContext = dbContextFactory.CreateDbContext(new string[] { }); CoreUnitOfWork = new EfCoreUnitOfWork(DbContext); var firstBankService = new FirstBankService(); BankRoutingService = new BankRoutingService(firstBankService); FeeService = new FeeService(); var inMemorySettings = new Dictionary <string, string> { { "MaxDeposit", "1000000" }, { "MaxWithdraw", "100000" }, { "DaysAfterWalletCreationWithNoFee", "7" }, { "IsFirstTransferFreeInMonth", "True" }, { "FixedFee", "100" }, { "FeeLimit", "10000" }, { "PercentageFee", "1" } }; Configuration = new ConfigurationBuilder() .AddInMemoryCollection(inMemorySettings) .Build(); }
public static async Task AssemblyInit(TestContext context) { var dbContextFactory = new SampleDbContextFactory(); using (var dbContext = dbContextFactory.CreateDbContext(new string[] { })) { await dbContext.Database.EnsureCreatedAsync(); } }
public static async Task AssemblyCleanup() { var dbContextFactory = new SampleDbContextFactory(); using (var dbContext = dbContextFactory.CreateDbContext(new string[] { })) { await dbContext.Database.EnsureDeletedAsync(); } }