Example #1
0
        private void Configure(MemstateSettings settings)
        {
            var logProvider = new TestOutputLoggingProvider(_log);

            logProvider.MinimumLogLevel = LogLevel.Information;
            settings.LoggerFactory.AddProvider(logProvider);
            settings.StreamName = _randomStreamName;
        }
Example #2
0
        public async Task CanWriteOne(MemstateSettings settings)
        {
            var logProvider = new TestOutputLoggingProvider(_log);

            logProvider.MinimumLogLevel = LogLevel.Trace;
            settings.LoggerFactory.AddProvider(logProvider);
            settings.StreamName = _randomStreamName;
            _log.WriteLine(settings.ToString());

            var provider = settings.CreateStorageProvider();

            provider.Initialize();
            var writer = provider.CreateJournalWriter(0);

            writer.Send(new AddStringCommand("hello"));
            await writer.DisposeAsync().ConfigureAwait(false);

            var reader  = provider.CreateJournalReader();
            var records = reader.GetRecords().ToArray();
            await reader.DisposeAsync().ConfigureAwait(false);

            Assert.Equal(1, records.Length);
        }