Beispiel #1
0
        public void GivenWindowsEventLogAndDefaultEntryTypeShouldWriteEntry()
        {
            const string source    = "source";
            const string message   = "message";
            EventType    eventType = new EventType();

            LogAuthorFake   logAuthorFake   = new LogAuthorFake();
            WindowsEventLog windowsEventLog = new WindowsEventLog(logAuthorFake);

            windowsEventLog.WriteEntry(source, message, eventType);

            logAuthorFake.LogEntries().Count.Should().Be(1);
            logAuthorFake.LogEntries().First().Source().Should().Be(source);
            logAuthorFake.LogEntries().First().Message().Should().Be(message);
            logAuthorFake.LogEntries().First().EventType().Should().Be(eventType);
        }
Beispiel #2
0
        public void GivenAiTelemetryAndDefaultEntryTypeShouldWriteEntry()
        {
            const string source    = "source";
            const string message   = "message";
            EventType    eventType = new EventType();

            LogAuthorFake          logAuthorFake          = new LogAuthorFake();
            ApplicationInsightsLog applicationInsightsLog = new ApplicationInsightsLog(logAuthorFake);

            applicationInsightsLog.WriteEntry(source, message, eventType);

            logAuthorFake.LogEntries().Count.Should().Be(1);
            logAuthorFake.LogEntries().First().Source().Should().Be(source);
            logAuthorFake.LogEntries().First().Message().Should().Be(message);
            logAuthorFake.LogEntries().First().EventType().Should().Be(eventType);
        }