Пример #1
0
        public void Log_InitializedProvider_Succeeds()
        {
            // Arrange
            var provider = new FakeWindowsEventLogLoggingProvider();

            provider.Initialize("Valid name", CreateValidConfiguration());

            // Act
            provider.Log("Some message");
        }
Пример #2
0
        public void Log_WithLoggingEventTypeDebug_LogsEventWithoutEventLogEntryType()
        {
            // Arrange
            var loggedLoggingEventType = LoggingEventType.Debug;
            FakeWindowsEventLogLoggingProvider provider = BuildInitializedProvider();

            // Act
            provider.Log(loggedLoggingEventType, "Valid message");

            // Assert
            Assert.AreEqual(null, provider.LoggedType);
        }
Пример #3
0
        public void Log_WithLoggingEventTypeInformation_LogsEventLogEntryTypeInformation()
        {
            // Arrange
            var loggedLoggingEventType = LoggingEventType.Information;
            var expectedWindowsLogType = EventLogEntryType.Information;
            FakeWindowsEventLogLoggingProvider provider = BuildInitializedProvider();

            // Act
            provider.Log(loggedLoggingEventType, "Valid message");

            // Assert
            Assert.AreEqual(expectedWindowsLogType, provider.LoggedType);
        }