public void GetPathOrDefault_Success() { IServiceProvider services = new ServiceCollection().AddInstance <IHostingEnvironment>(new TestHostingEnvironment()).BuildServiceProvider(); string result = SqliteStorageEngineBuilder.GetPathOrDefault(services, "data.db"); Assert.Equal(@"\path\App_Data\data.db", result); }
public SqliteStorageEngineTests() { SqliteStorageEngine store = new SqliteStorageEngine(":memory:"); store.Initialize().Wait(); SqliteStorageEngineBuilder.InitializeTables(store.Connection).Wait(); this.Store = store; }
public async Task Build_Success() { SqliteStorageEngineBuilder builder = new SqliteStorageEngineBuilder(); await builder.Initialize(new ServiceCollection().BuildServiceProvider(), configuration); SqliteLedger ledger = builder.Build(null); Assert.NotNull(ledger); }
public async Task Build_Success() { SqliteStorageEngineBuilder builder = new SqliteStorageEngineBuilder(); await builder.Initialize(new ServiceCollection().BuildServiceProvider(), configuration); SqliteLedger ledger = builder.Build(null); Assert.NotNull(ledger); }
public SqliteLedgerTests() { SqliteLedger store = new SqliteLedger(":memory:"); store.Initialize().Wait(); SqliteStorageEngineBuilder.InitializeTables(store.Connection).Wait(); this.Engine = store; this.Queries = store; this.Indexes = store; }
public async Task InitializeTables_CallTwice() { SqliteStorageEngineBuilder builder = new SqliteStorageEngineBuilder(); await builder.Initialize(new ServiceCollection().BuildServiceProvider(), configuration); SqliteLedger ledger = builder.Build(null); await SqliteStorageEngineBuilder.InitializeTables(ledger.Connection); await SqliteStorageEngineBuilder.InitializeTables(ledger.Connection); Assert.Equal(ConnectionState.Open, ledger.Connection.State); }
public async Task InitializeTables_CallTwice() { SqliteStorageEngineBuilder builder = new SqliteStorageEngineBuilder(); await builder.Initialize(new ServiceCollection().BuildServiceProvider(), configuration); SqliteLedger ledger = builder.Build(null); await SqliteStorageEngineBuilder.InitializeTables(ledger.Connection); await SqliteStorageEngineBuilder.InitializeTables(ledger.Connection); Assert.Equal(ConnectionState.Open, ledger.Connection.State); }