diff --git a/src/Microsoft.AspNet.TelemetryCorrelation/AssemblyInfo.cs b/src/Microsoft.AspNet.TelemetryCorrelation/AssemblyInfo.cs index f498bfb7804..890303af426 100644 --- a/src/Microsoft.AspNet.TelemetryCorrelation/AssemblyInfo.cs +++ b/src/Microsoft.AspNet.TelemetryCorrelation/AssemblyInfo.cs @@ -14,14 +14,21 @@ // limitations under the License. // -using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: ComVisible(false)] -#if PUBLIC_RELEASE -[assembly: InternalsVisibleTo("Microsoft.AspNet.TelemetryCorrelation.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] +[assembly: InternalsVisibleTo("Microsoft.AspNet.TelemetryCorrelation.Tests" + AssemblyInfo.PublicKey)] + +#if SIGNED +internal static class AssemblyInfo +{ + public const string PublicKey = ", PublicKey=002400000480000094000000060200000024000052534131000400000100010051C1562A090FB0C9F391012A32198B5E5D9A60E9B80FA2D7B434C9E5CCB7259BD606E66F9660676AFC6692B8CDC6793D190904551D2103B7B22FA636DCBB8208839785BA402EA08FC00C8F1500CCEF28BBF599AA64FFB1E1D5DC1BF3420A3777BADFE697856E9D52070A50C3EA5821C80BEF17CA3ACFFA28F89DD413F096F898"; +} #else -[assembly: InternalsVisibleTo("Microsoft.AspNet.TelemetryCorrelation.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100319b35b21a993df850846602dae9e86d8fbb0528a0ad488ecd6414db798996534381825f94f90d8b16b72a51c4e7e07cf66ff3293c1046c045fafc354cfcc15fc177c748111e4a8c5a34d3940e7f3789dd58a928add6160d6f9cc219680253dcea88a034e7d472de51d4989c7783e19343839273e0e63a43b99ab338149dd59f")] -#endif \ No newline at end of file +internal static class AssemblyInfo +{ + public const string PublicKey = ""; +} +#endif diff --git a/test/Microsoft.AspNet.TelemetryCorrelation.Tests/ActivityExtensionsTest.cs b/test/Microsoft.AspNet.TelemetryCorrelation.Tests/ActivityExtensionsTest.cs index 8b3e1ef7a05..9f51e8dc590 100644 --- a/test/Microsoft.AspNet.TelemetryCorrelation.Tests/ActivityExtensionsTest.cs +++ b/test/Microsoft.AspNet.TelemetryCorrelation.Tests/ActivityExtensionsTest.cs @@ -46,7 +46,7 @@ public void Can_Restore_First_RequestId_When_Multiple_RequestId_In_Headers() var requestHeaders = new NameValueCollection { { ActivityExtensions.RequestIdHeaderName, "|aba2f1e978b11111.1" }, - { ActivityExtensions.RequestIdHeaderName, "|aba2f1e978b22222.1" } + { ActivityExtensions.RequestIdHeaderName, "|aba2f1e978b22222.1" }, }; Assert.True(activity.Extract(requestHeaders)); @@ -61,7 +61,7 @@ public void Extract_RequestId_Is_Ignored_When_Traceparent_Is_Present() var requestHeaders = new NameValueCollection { { ActivityExtensions.RequestIdHeaderName, "|aba2f1e978b11111.1" }, - { ActivityExtensions.TraceparentHeaderName, "00-0123456789abcdef0123456789abcdef-0123456789abcdef-00" } + { ActivityExtensions.TraceparentHeaderName, "00-0123456789abcdef0123456789abcdef-0123456789abcdef-00" }, }; Assert.True(activity.Extract(requestHeaders)); @@ -83,7 +83,7 @@ public void Can_Extract_First_Traceparent_When_Multiple_Traceparents_In_Headers( var requestHeaders = new NameValueCollection { { ActivityExtensions.TraceparentHeaderName, "00-0123456789abcdef0123456789abcdef-0123456789abcdef-00" }, - { ActivityExtensions.TraceparentHeaderName, "00-fedcba09876543210fedcba09876543210-fedcba09876543210-01" } + { ActivityExtensions.TraceparentHeaderName, "00-fedcba09876543210fedcba09876543210-fedcba09876543210-01" }, }; Assert.True(activity.Extract(requestHeaders)); @@ -121,7 +121,7 @@ public void Can_Extract_RootActivity_From_W3C_Headers_And_CC() { new KeyValuePair("key1", "123"), new KeyValuePair("key2", "456"), - new KeyValuePair("key3", "789") + new KeyValuePair("key3", "789"), }; var expectedBaggage = baggageItems.OrderBy(kvp => kvp.Key); var actualBaggage = activity.Baggage.OrderBy(kvp => kvp.Key); @@ -170,7 +170,7 @@ public void Restore_Empty_RequestId_Should_Not_Throw_Exception() var activity = new Activity(TestActivityName); var requestHeaders = new NameValueCollection { - { ActivityExtensions.RequestIdHeaderName, string.Empty } + { ActivityExtensions.RequestIdHeaderName, string.Empty }, }; Assert.False(activity.Extract(requestHeaders)); @@ -184,7 +184,7 @@ public void Restore_Empty_Traceparent_Should_Not_Throw_Exception() var activity = new Activity(TestActivityName); var requestHeaders = new NameValueCollection { - { ActivityExtensions.TraceparentHeaderName, string.Empty } + { ActivityExtensions.TraceparentHeaderName, string.Empty }, }; Assert.False(activity.Extract(requestHeaders)); @@ -200,7 +200,7 @@ public void Can_Restore_Baggages_When_CorrelationContext_In_Headers() var requestHeaders = new NameValueCollection { { ActivityExtensions.RequestIdHeaderName, "|aba2f1e978b11111.1" }, - { ActivityExtensions.CorrelationContextHeaderName, "key1=123,key2=456,key3=789" } + { ActivityExtensions.CorrelationContextHeaderName, "key1=123,key2=456,key3=789" }, }; Assert.True(activity.Extract(requestHeaders)); @@ -209,7 +209,7 @@ public void Can_Restore_Baggages_When_CorrelationContext_In_Headers() { new KeyValuePair("key1", "123"), new KeyValuePair("key2", "456"), - new KeyValuePair("key3", "789") + new KeyValuePair("key3", "789"), }; var expectedBaggage = baggageItems.OrderBy(kvp => kvp.Key); var actualBaggage = activity.Baggage.OrderBy(kvp => kvp.Key); @@ -225,7 +225,7 @@ public void Can_Restore_Baggages_When_Multiple_CorrelationContext_In_Headers() { ActivityExtensions.RequestIdHeaderName, "|aba2f1e978b11111.1" }, { ActivityExtensions.CorrelationContextHeaderName, "key1=123,key2=456,key3=789" }, { ActivityExtensions.CorrelationContextHeaderName, "key4=abc,key5=def" }, - { ActivityExtensions.CorrelationContextHeaderName, "key6=xyz" } + { ActivityExtensions.CorrelationContextHeaderName, "key6=xyz" }, }; Assert.True(activity.Extract(requestHeaders)); @@ -237,7 +237,7 @@ public void Can_Restore_Baggages_When_Multiple_CorrelationContext_In_Headers() new KeyValuePair("key3", "789"), new KeyValuePair("key4", "abc"), new KeyValuePair("key5", "def"), - new KeyValuePair("key6", "xyz") + new KeyValuePair("key6", "xyz"), }; var expectedBaggage = baggageItems.OrderBy(kvp => kvp.Key); var actualBaggage = activity.Baggage.OrderBy(kvp => kvp.Key); @@ -254,7 +254,7 @@ public void Can_Restore_Baggages_When_Some_MalFormat_CorrelationContext_In_Heade { ActivityExtensions.CorrelationContextHeaderName, "key1=123,key2=456,key3=789" }, { ActivityExtensions.CorrelationContextHeaderName, "key4=abc;key5=def" }, { ActivityExtensions.CorrelationContextHeaderName, "key6????xyz" }, - { ActivityExtensions.CorrelationContextHeaderName, "key7=123=456" } + { ActivityExtensions.CorrelationContextHeaderName, "key7=123=456" }, }; Assert.True(activity.Extract(requestHeaders)); @@ -263,7 +263,7 @@ public void Can_Restore_Baggages_When_Some_MalFormat_CorrelationContext_In_Heade { new KeyValuePair("key1", "123"), new KeyValuePair("key2", "456"), - new KeyValuePair("key3", "789") + new KeyValuePair("key3", "789"), }; var expectedBaggage = baggageItems.OrderBy(kvp => kvp.Key); var actualBaggage = activity.Baggage.OrderBy(kvp => kvp.Key); @@ -304,7 +304,7 @@ public void Validates_Correlation_Context_Length(string correlationContext, int var requestHeaders = new NameValueCollection { { ActivityExtensions.RequestIdHeaderName, "|abc.1" }, - { ActivityExtensions.CorrelationContextHeaderName, correlationContext } + { ActivityExtensions.CorrelationContextHeaderName, correlationContext }, }; Assert.True(activity.Extract(requestHeaders)); diff --git a/test/Microsoft.AspNet.TelemetryCorrelation.Tests/ActivityHelperTest.cs b/test/Microsoft.AspNet.TelemetryCorrelation.Tests/ActivityHelperTest.cs index 03fc4975014..40e86a9e8d7 100644 --- a/test/Microsoft.AspNet.TelemetryCorrelation.Tests/ActivityHelperTest.cs +++ b/test/Microsoft.AspNet.TelemetryCorrelation.Tests/ActivityHelperTest.cs @@ -42,7 +42,7 @@ public ActivityHelperTest() { new KeyValuePair("TestKey1", "123"), new KeyValuePair("TestKey2", "456"), - new KeyValuePair("TestKey1", "789") + new KeyValuePair("TestKey1", "789"), }; this.baggageInHeader = "TestKey1=123,TestKey2=456,TestKey1=789"; @@ -331,7 +331,7 @@ public void Can_Create_RootActivity_And_Restore_Info_From_Request_Header() var requestHeaders = new Dictionary { { ActivityExtensions.RequestIdHeaderName, "|aba2f1e978b2cab6.1." }, - { ActivityExtensions.CorrelationContextHeaderName, this.baggageInHeader } + { ActivityExtensions.CorrelationContextHeaderName, this.baggageInHeader }, }; var context = HttpContextHelper.GetFakeHttpContext(headers: requestHeaders); @@ -401,7 +401,7 @@ public void Can_Create_RootActivity_And_Ignore_Info_From_Request_Header_If_Parse var requestHeaders = new Dictionary { { ActivityExtensions.RequestIdHeaderName, "|aba2f1e978b2cab6.1." }, - { ActivityExtensions.CorrelationContextHeaderName, this.baggageInHeader } + { ActivityExtensions.CorrelationContextHeaderName, this.baggageInHeader }, }; var context = HttpContextHelper.GetFakeHttpContext(headers: requestHeaders); diff --git a/test/Microsoft.AspNet.TelemetryCorrelation.Tests/Microsoft.AspNet.TelemetryCorrelation.Tests.csproj b/test/Microsoft.AspNet.TelemetryCorrelation.Tests/Microsoft.AspNet.TelemetryCorrelation.Tests.csproj index 76337c01c09..93819ccf2b3 100644 --- a/test/Microsoft.AspNet.TelemetryCorrelation.Tests/Microsoft.AspNet.TelemetryCorrelation.Tests.csproj +++ b/test/Microsoft.AspNet.TelemetryCorrelation.Tests/Microsoft.AspNet.TelemetryCorrelation.Tests.csproj @@ -1,82 +1,33 @@ - - + - Debug - AnyCPU - {9FAE5C43-F56C-4D87-A23C-6D2D57B4ABED} - Library - net452 - 512 - prompt - 4 - - - true - full - false - $(DefineConstants);DEBUG;TRACE - - - pdbonly - true - $(DefineConstants);TRACE - - - true - - - true - $(RepositoryRoot)tools\35MSSharedLib1024.snk - $(DefineConstants);PUBLIC_RELEASE - - - false - $(RepositoryRoot)tools\Debug.snk + Unit test project for ASP.NET HttpModule + net461 + false + - - - - - - - + - - - - - - - - - - - - - - - All - - - All + + + all + runtime; build; native; contentfiles; analyzers - - {4c8e592c-c532-4cf2-80ef-3bdd0d788d12} - Microsoft.AspNet.TelemetryCorrelation - + + - + + + + + Resources\web.config.install.xdt - + Resources\web.config.uninstall.xdt - - - \ No newline at end of file