Esempio n. 1
0
        public async Task AuditSinkEmitsIndividualEvents()
        {
            LogEvent evt1 = Some.InformationEvent("first"), evt2 = Some.InformationEvent("second");

            var api  = new TestIngestionApi();
            var sink = new SeqAuditSink(api);

            sink.Emit(evt1);
            sink.Emit(evt2);

            var first = await api.GetPayloadAsync();

            Assert.Contains("first", first.Payload);

            var second = await api.GetPayloadAsync();

            Assert.Contains("second", second.Payload);
        }
Esempio n. 2
0
        public async Task EventsAreFormattedIntoPayloads()
        {
            var api  = new TestIngestionApi();
            var sink = new BatchedSeqSink(api, null, new ControlledLevelSwitch());

            await sink.EmitBatchAsync(new[]
            {
                Some.InformationEvent("first"),
                Some.InformationEvent("second")
            });

            var emitted = await api.GetPayloadAsync();

            Assert.Contains("first", emitted.Payload);
            Assert.Contains("second", emitted.Payload);
        }