public void When_number_of_LogEvents_equals_Buffer_nothing_is_sent_to_ElasticSearch() { using (var context = UnitTestContext.Create()) { context.Appender.DoAppend(LoggingEventsBuilder.OfSize(context.Appender.BufferSize).ToArray()); Retry.Ignoring <AssertException>(() => context.Repository.LogEntries.TotalCount() .Should() .Be(0, "nothing should be logged when the buffer limit hasn't been exceeded")); } }
public void When_number_of_LogEvents_exceeds_Buffer_by_1_then_Buffer_is_sent_to_ElasticSearch() { using (var context = UnitTestContext.Create()) { var loggingEvents = LoggingEventsBuilder.OfSize(100 + 1).ToArray(); context.Appender.DoAppend(loggingEvents); Retry.Ignoring <XunitException>(() => context.Repository.LogEntries.TotalCount() .Should() .Be(loggingEvents.Count(), "buffer should be sent to ElasticSearch")); } }