diff --git a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/Logging/RedactedLogValueIntegrationTest.cs b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/Logging/RedactedLogValueIntegrationTest.cs index 7128daa504599..4a4c1327401c1 100644 --- a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/Logging/RedactedLogValueIntegrationTest.cs +++ b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/Logging/RedactedLogValueIntegrationTest.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Linq; using System.Net.Http; using System.Net.Http.Headers; @@ -50,11 +51,11 @@ public async Task RedactHeaderValueWithHeaderList_ValueIsRedactedBeforeLogging() m.EventId == LoggingScopeHttpMessageHandler.Log.EventIds.RequestHeader && m.LoggerName == "System.Net.Http.HttpClient.test.LogicalHandler"; })); - Assert.StartsWith( + Assert.StartsWith(LineEndingsHelper.Normalize( @"Request Headers: Authorization: * Cache-Control: no-cache -", message.Message); +"), message.Message); message = Assert.Single(messages.Where(m => { @@ -62,11 +63,11 @@ public async Task RedactHeaderValueWithHeaderList_ValueIsRedactedBeforeLogging() m.EventId == LoggingHttpMessageHandler.Log.EventIds.RequestHeader && m.LoggerName == "System.Net.Http.HttpClient.test.ClientHandler"; })); - Assert.StartsWith( + Assert.StartsWith(LineEndingsHelper.Normalize( @"Request Headers: Authorization: * Cache-Control: no-cache -", message.Message); +"), message.Message); message = Assert.Single(messages.Where(m => { @@ -74,11 +75,11 @@ public async Task RedactHeaderValueWithHeaderList_ValueIsRedactedBeforeLogging() m.EventId == LoggingHttpMessageHandler.Log.EventIds.ResponseHeader && m.LoggerName == "System.Net.Http.HttpClient.test.ClientHandler"; })); - Assert.StartsWith( + Assert.StartsWith(LineEndingsHelper.Normalize( @"Response Headers: X-Sensitive: * Y-Non-Sensitive: innocuous value -", message.Message); +"), message.Message); message = Assert.Single(messages.Where(m => { @@ -86,11 +87,11 @@ public async Task RedactHeaderValueWithHeaderList_ValueIsRedactedBeforeLogging() m.EventId == LoggingScopeHttpMessageHandler.Log.EventIds.ResponseHeader && m.LoggerName == "System.Net.Http.HttpClient.test.LogicalHandler"; })); - Assert.StartsWith( + Assert.StartsWith(LineEndingsHelper.Normalize( @"Response Headers: X-Sensitive: * Y-Non-Sensitive: innocuous value -", message.Message); +"), message.Message); } [Fact] @@ -131,11 +132,11 @@ public async Task RedactHeaderValueWithPredicate_ValueIsRedactedBeforeLogging() m.EventId == LoggingScopeHttpMessageHandler.Log.EventIds.RequestHeader && m.LoggerName == "System.Net.Http.HttpClient.test.LogicalHandler"; })); - Assert.StartsWith( + Assert.StartsWith(LineEndingsHelper.Normalize( @"Request Headers: Authorization: * Cache-Control: no-cache -", message.Message); +"), message.Message); message = Assert.Single(messages.Where(m => { @@ -143,11 +144,11 @@ public async Task RedactHeaderValueWithPredicate_ValueIsRedactedBeforeLogging() m.EventId == LoggingHttpMessageHandler.Log.EventIds.RequestHeader && m.LoggerName == "System.Net.Http.HttpClient.test.ClientHandler"; })); - Assert.StartsWith( + Assert.StartsWith(LineEndingsHelper.Normalize( @"Request Headers: Authorization: * Cache-Control: no-cache -", message.Message); +"), message.Message); message = Assert.Single(messages.Where(m => { @@ -155,11 +156,11 @@ public async Task RedactHeaderValueWithPredicate_ValueIsRedactedBeforeLogging() m.EventId == LoggingHttpMessageHandler.Log.EventIds.ResponseHeader && m.LoggerName == "System.Net.Http.HttpClient.test.ClientHandler"; })); - Assert.StartsWith( + Assert.StartsWith(LineEndingsHelper.Normalize( @"Response Headers: X-Sensitive: * Y-Non-Sensitive: innocuous value -", message.Message); +"), message.Message); message = Assert.Single(messages.Where(m => { @@ -167,11 +168,11 @@ public async Task RedactHeaderValueWithPredicate_ValueIsRedactedBeforeLogging() m.EventId == LoggingScopeHttpMessageHandler.Log.EventIds.ResponseHeader && m.LoggerName == "System.Net.Http.HttpClient.test.LogicalHandler"; })); - Assert.StartsWith( + Assert.StartsWith(LineEndingsHelper.Normalize( @"Response Headers: X-Sensitive: * Y-Non-Sensitive: innocuous value -", message.Message); +"), message.Message); } private class TestMessageHandler : HttpClientHandler diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 1862f4493ba8c..88f58d837d2a8 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -296,7 +296,6 @@ -