コード例 #1
0
        public void DefaultLogNameMapperWorksAsExpected()
        {
            // --- Arrange
            var mapper1 = new DefaultLogNameMapper();
            var mapper2 = new DefaultLogNameMapper("Dummy");

            // --- Act
            var name11 = mapper1.Map(WindowsEventLogger.DEFAULT_APP_LOG);
            var name12 = mapper1.Map("Hi");
            var name21 = mapper2.Map(WindowsEventLogger.DEFAULT_APP_LOG);
            var name22 = mapper2.Map("Hello");

            // --- Assert
            name11.ShouldEqual("Application");
            name12.ShouldEqual("Hi");
            name21.ShouldEqual("Dummy");
            name22.ShouldEqual("Hello");
        }
コード例 #2
0
 /// <summary>
 /// Sets up the static members of this class
 /// </summary>
 static WindowsEventLogger()
 {
     LogNameMapper   = new DefaultLogNameMapper();
     LogSourceMapper = new DefaultLogSourceNameMapper();
 }