public async Task Build_Success()
        {
            SqliteAnchorStateBuilder builder = new SqliteAnchorStateBuilder();

            await builder.Initialize(new ServiceCollection().BuildServiceProvider(), configuration);

            SqliteAnchorState ledger = builder.Build(null);

            Assert.NotNull(ledger);
        }
        public async Task Build_Success()
        {
            SqliteAnchorStateBuilder builder = new SqliteAnchorStateBuilder();

            await builder.Initialize(new ServiceCollection().BuildServiceProvider(), configuration);

            SqliteAnchorState ledger = builder.Build(null);

            Assert.NotNull(ledger);
        }
        public async Task InitializeTables_CallTwice()
        {
            SqliteAnchorStateBuilder builder = new SqliteAnchorStateBuilder();

            await builder.Initialize(new ServiceCollection().BuildServiceProvider(), configuration);

            SqliteAnchorState ledger = builder.Build(null);

            await SqliteAnchorStateBuilder.InitializeTables(ledger.Connection);
            await SqliteAnchorStateBuilder.InitializeTables(ledger.Connection);

            Assert.Equal(ConnectionState.Open, ledger.Connection.State);
        }
        public async Task InitializeTables_CallTwice()
        {
            SqliteAnchorStateBuilder builder = new SqliteAnchorStateBuilder();

            await builder.Initialize(new ServiceCollection().BuildServiceProvider(), configuration);

            SqliteAnchorState ledger = builder.Build(null);

            await SqliteAnchorStateBuilder.InitializeTables(ledger.Connection);

            await SqliteAnchorStateBuilder.InitializeTables(ledger.Connection);

            Assert.Equal(ConnectionState.Open, ledger.Connection.State);
        }
Ejemplo n.º 5
0
 public SqliteAnchorStateTests()
 {
     this.anchorBuilder = new SqliteAnchorState(":memory:");
     this.anchorBuilder.Initialize().Wait();
     SqliteAnchorStateBuilder.InitializeTables(this.anchorBuilder.Connection).Wait();
 }