コード例 #1
0
        public async Task WithDatabaseAsync(Func <RoxisDatabase, MemoryClock, Task> test)
        {
            var databasePath = Guid.NewGuid().ToString();

            using var disposableDatabaseGuard = new DisposableDirectory(new PassThroughFileSystem(), databasePath);

            var clock = new MemoryClock();
            var databaseConfiguration = new RoxisDatabaseConfiguration()
            {
                Path = databasePath,
            };
            var database = new RoxisDatabase(databaseConfiguration, clock);

            // TODO: use proper logger
            var logger         = NullLogger.Instance;
            var tracingContext = new Context(logger);
            var context        = new OperationContext(tracingContext);

            await database.StartupAsync(context).ThrowIfFailureAsync();

            await test(database, clock);

            await database.ShutdownAsync(context).ThrowIfFailureAsync();
        }
コード例 #2
0
 public LocalRoxisClient(RoxisDatabase database)
 {
     _database = database;
 }