Пример #1
0
        public void DiagnosticSourceArgumentStringTestWithEscapedValue1()
        {
            string diagnosticFilterString = "Microsoft.AspNetCore/Microsoft.AspNetCore.Hosting.HttpRequestIn.Start@Activity1Start:-" +
                                            "Request.Path" +
                                            ";Request.Method" +
                                            "\r\n";

            var provider = new EventPipeProvider("DiagnosticSourceProvider", EventLevel.Verbose, (long)(0xdeadbeef),
                                                 new Dictionary <string, string>()
            {
                { "FilterAndPayloadSpecs", diagnosticFilterString }
            });

            Assert.Equal("DiagnosticSourceProvider:0x00000000DEADBEEF:5:FilterAndPayloadSpecs=\"Microsoft.AspNetCore/Microsoft.AspNetCore.Hosting.HttpRequestIn.Start@Activity1Start:-Request.Path;Request.Method\r\n\"",
                         provider.ToString());
        }
        public void ToStringTest2()
        {
            var provider1 = new EventPipeProvider("MyProvider", EventLevel.Verbose, (long)(0xdeadbeef),
                                                  new Dictionary <string, string>()
            {
                { "key1", "value1" },
            });
            var provider2 = new EventPipeProvider("MyProvider", EventLevel.Verbose, (long)(0xdeadbeef),
                                                  new Dictionary <string, string>()
            {
                { "key1", "value1" },
                { "key2", "value2" }
            });

            Assert.Equal("MyProvider:0x00000000DEADBEEF:5:key1=value1", provider1.ToString());
            Assert.Equal("MyProvider:0x00000000DEADBEEF:5:key1=value1;key2=value2", provider2.ToString());
        }
Пример #3
0
        public void DiagnosticSourceArgumentStringTestWithEscapedKey()
        {
            string diagnosticFilterString = "Microsoft.AspNetCore/Microsoft.AspNetCore.Hosting.HttpRequestIn.Start@Activity1Start:-" +
                                            "Request.Path" +
                                            ";Request.Method" +
                                            ";RequestName=SomeRequest" +
                                            "\r\n";

            var provider = new EventPipeProvider("DiagnosticSourceProvider", EventLevel.Verbose, (long)(0xdeadbeef),
                                                 new Dictionary <string, string>()
            {
                { "ArgumentKeyWith;Semicolon=Equal", diagnosticFilterString }
            });

            Assert.Equal("DiagnosticSourceProvider:0x00000000DEADBEEF:5:\"ArgumentKeyWith;Semicolon=Equal\"=\"Microsoft.AspNetCore/Microsoft.AspNetCore.Hosting.HttpRequestIn.Start@Activity1Start:-Request.Path;Request.Method;RequestName=SomeRequest\r\n\"",
                         provider.ToString());
        }
        public void ToStringTest1()
        {
            var provider = new EventPipeProvider("MyProvider", EventLevel.Verbose, (long)(0xdeadbeef));

            Assert.Equal("MyProvider:0x00000000DEADBEEF:5", provider.ToString());
        }