diff --git a/test/Microsoft.AspNetCore.SignalR.Client.FunctionalTests/HubConnectionTests.cs b/test/Microsoft.AspNetCore.SignalR.Client.FunctionalTests/HubConnectionTests.cs index 5290c528cb..8a70874b33 100644 --- a/test/Microsoft.AspNetCore.SignalR.Client.FunctionalTests/HubConnectionTests.cs +++ b/test/Microsoft.AspNetCore.SignalR.Client.FunctionalTests/HubConnectionTests.cs @@ -5,12 +5,14 @@ using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; +using System.Runtime.CompilerServices; using System.Threading; using System.Threading.Channels; using System.Threading.Tasks; using Microsoft.AspNetCore.Connections; using Microsoft.AspNetCore.Http.Connections; using Microsoft.AspNetCore.Http.Connections.Client; +using Microsoft.AspNetCore.SignalR.Internal; using Microsoft.AspNetCore.SignalR.Protocol; using Microsoft.AspNetCore.SignalR.Tests; using Microsoft.AspNetCore.Testing.xunit; @@ -429,7 +431,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests { bool ExpectedErrors(WriteContext writeContext) { - return //writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && + return writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && writeContext.EventId.Name == "FailedInvokingHubMethod"; } @@ -463,7 +465,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests { bool ExpectedErrors(WriteContext writeContext) { - return //writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && + return writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && writeContext.EventId.Name == "UnknownHubMethod"; } @@ -496,7 +498,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests { bool ExpectedErrors(WriteContext writeContext) { - return //writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && + return writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && writeContext.EventId.Name == "FailedInvokingHubMethod"; } @@ -529,7 +531,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests { bool ExpectedErrors(WriteContext writeContext) { - return //writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && + return writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && writeContext.EventId.Name == "FailedInvokingHubMethod"; } @@ -562,7 +564,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests { bool ExpectedErrors(WriteContext writeContext) { - return //writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && + return writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && writeContext.EventId.Name == "UnknownHubMethod"; } @@ -596,7 +598,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests { bool ExpectedErrors(WriteContext writeContext) { - return //writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && + return writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && writeContext.EventId.Name == "FailedInvokingHubMethod"; } @@ -631,7 +633,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests { bool ExpectedErrors(WriteContext writeContext) { - return //writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && + return writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && writeContext.EventId.Name == "FailedInvokingHubMethod"; } @@ -665,7 +667,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests { bool ExpectedErrors(WriteContext writeContext) { - return //writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && + return writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && writeContext.EventId.Name == "NonStreamingMethodCalledWithStream"; } @@ -698,7 +700,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests { bool ExpectedErrors(WriteContext writeContext) { - return //writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && + return writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && writeContext.EventId.Name == "StreamingMethodCalledWithInvoke"; } @@ -731,7 +733,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests { bool ExpectedErrors(WriteContext writeContext) { - return //writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && + return writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && writeContext.EventId.Name == "InvalidReturnValueFromStreamingMethod"; } diff --git a/test/Microsoft.AspNetCore.SignalR.Tests.Utils/ServerLogScope.cs b/test/Microsoft.AspNetCore.SignalR.Tests.Utils/ServerLogScope.cs index 3652dd66e2..ead19e80a3 100644 --- a/test/Microsoft.AspNetCore.SignalR.Tests.Utils/ServerLogScope.cs +++ b/test/Microsoft.AspNetCore.SignalR.Tests.Utils/ServerLogScope.cs @@ -13,13 +13,11 @@ namespace Microsoft.AspNetCore.SignalR.Tests private readonly ILoggerFactory _loggerFactory; private readonly IDisposable _wrappedDisposable; private readonly ConcurrentDictionary _loggers; - //private readonly ILogger _logger; public ServerLogScope(ServerFixture serverFixture, ILoggerFactory loggerFactory, IDisposable wrappedDisposable) { _serverFixture = serverFixture; _loggerFactory = loggerFactory; - //_logger = loggerFactory.CreateLogger(typeof(ServerLogScope)); _wrappedDisposable = wrappedDisposable; _loggers = new ConcurrentDictionary(StringComparer.Ordinal); @@ -30,7 +28,6 @@ namespace Microsoft.AspNetCore.SignalR.Tests { var logger = _loggers.GetOrAdd(logRecord.Write.LoggerName, loggerName => _loggerFactory.CreateLogger(loggerName)); logger.Log(logRecord.Write.LogLevel, logRecord.Write.EventId, logRecord.Write.State, logRecord.Write.Exception, logRecord.Write.Formatter); - //_logger.Log(logRecord.Write.LogLevel, logRecord.Write.EventId, logRecord.Write.State, logRecord.Write.Exception, logRecord.Write.Formatter); } public void Dispose()