コード例 #1
0
        public RocksDbContentLocationDatabaseTests(ITestOutputHelper output)
            : base(output)
        {
            // Need to use unique folder for each test instance, because more then one test may be executed simultaneously.
            var uniqueOutputFolder = Guid.NewGuid().ToString();

            _workingDirectory = new DisposableDirectory(new PassThroughFileSystem(TestGlobal.Logger), Path.Combine(uniqueOutputFolder, "redis"));

            DefaultConfiguration = new RocksDbContentLocationDatabaseConfiguration(_workingDirectory.Path / "rocksdb");
        }
コード例 #2
0
        private async Task RunCustomTest(ContentLocationDatabaseConfiguration configuration, Action <OperationContext, ContentLocationDatabase> action, OperationContext?overwrite = null)
        {
            var tracingContext   = new Context(TestGlobal.Logger);
            var operationContext = overwrite ?? new OperationContext(tracingContext);

            var database = ContentLocationDatabase.Create(Clock, configuration, () => new MachineId[] { });
            await database.StartupAsync(operationContext).ShouldBeSuccess();

            database.SetDatabaseMode(isDatabaseWritable: true);

            action(operationContext, database);

            await database.ShutdownAsync(operationContext).ShouldBeSuccess();
        }