Пример #1
0
        public void FormatLogEvent_ValidLog_ExpectedTextIsReturned()
        {
            // Arrange
            var filters   = this.GetDefaultFilters();
            var formatter = new DefaultFormatter();
            var entry     = new LogEvent(LogLevel.Info, DateTime.Parse("2022-10-22 22:22:31.678"), "This is a log entry");

            var expectedText = "[Log] [Info] This is a log entry";

            // Act
            var outputText = formatter.FormatLogEvent(22, 1, 33, entry, filters, true);

            // Assert
            Assert.That(outputText, Is.Not.Empty, "Expected a string to be returned");
            Assert.That(outputText, Is.EqualTo(expectedText), "Not the expected output text, you may need to adjust the test if the formatter has been changed.");
        }