Beispiel #1
0
        public async Task CanWriteOne(MemstateSettings settings)
        {
            settings.LoggerFactory.AddProvider(new TestOutputLoggingProvider(_log));
            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);
        }