Skip to content

Commit b31cca0

Browse files
committed
refs or cleanup
1 parent 85bba59 commit b31cca0

9 files changed

Lines changed: 11 additions & 16 deletions

src/Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
<PackageVersion Include="NServiceBus.Extensions.Hosting" Version="4.0.0" />
1515
<PackageVersion Include="ProjectDefaults" Version="1.0.172" />
1616
<PackageVersion Include="System.ServiceProcess.ServiceController" Version="10.0.3" />
17-
<PackageVersion Include="TUnit" Version="1.15.11" />
17+
<PackageVersion Include="TUnit" Version="1.16.0" />
1818
</ItemGroup>
1919
</Project>

src/NsbMsLogging.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1414
appveyor.yml = appveyor.yml
1515
Directory.Build.props = Directory.Build.props
1616
..\readme.source.md = ..\readme.source.md
17-
global.json = global.json
17+
../global.json = ../global.json
1818
EndProjectSection
1919
EndProject
2020
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NServiceBus.Community.MicrosoftLogging.Hosting", "NServiceBus.Community.MicrosoftLogging.Hosting\NServiceBus.Community.MicrosoftLogging.Hosting.csproj", "{17F6502A-A481-4820-B2C7-08875D12929B}"

src/Tests/DeferredLoggerFactoryTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using NServiceBus.Logging;
2-
using System.Threading.Tasks;
32

43
/// <summary>
54
/// Tests for the DeferredLoggerFactory pattern using a local test implementation.
@@ -154,7 +153,7 @@ public void Write(string name, LogLevel messageLevel, string message)
154153
{
155154
return;
156155
}
157-
var logQueue = DeferredLogs.GetOrAdd(name, _ => new ConcurrentQueue<(LogLevel level, string message)>());
156+
var logQueue = DeferredLogs.GetOrAdd(name, _ => new());
158157
logQueue.Enqueue((messageLevel, message));
159158
}
160159
}

src/Tests/IntegrationTests.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using Microsoft.Extensions.Hosting;
33
using NServiceBus.Logging;
44
using Microsoft.Extensions.Logging;
5-
using System.Threading.Tasks;
65

76
public class IntegrationTests
87
{
@@ -18,17 +17,16 @@ public async Task Ensure_log_messages_are_redirected()
1817
var configuration = new EndpointConfiguration("Tests");
1918
configuration.UseTransport<LearningTransport>();
2019
configuration.UseSerialization<SystemJsonSerializer>();
21-
var cancel = TestContext.Current.CancellationToken;
22-
var endpoint = await Endpoint.Start(configuration, cancel);
20+
var endpoint = await Endpoint.Start(configuration);
2321

2422
var message = new MyMessage
2523
{
2624
DateSend = DateTime.Now,
2725
};
28-
await endpoint.SendLocal(message, cancellationToken: cancel);
29-
await Task.Delay(500, cancel);
26+
await endpoint.SendLocal(message);
27+
await Task.Delay(500);
3028
await Assert.That(LogMessageCapture.LoggingEvents).IsNotEmpty();
31-
await endpoint.Stop(cancel);
29+
await endpoint.Stop();
3230
}
3331

3432
[Test]

src/Tests/LoggerFactoryTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using NServiceBus.Logging;
2-
using System.Threading.Tasks;
32

43
/// <summary>
54
/// Tests for the LoggerFactory class through the public MicrosoftLogFactory API.

src/Tests/LoggerTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using Microsoft.Extensions.Logging;
22
using NServiceBus.Logging;
33
using MsLogLevel = Microsoft.Extensions.Logging.LogLevel;
4-
using System.Threading.Tasks;
54

65
/// <summary>
76
/// Tests for the Logger class that wraps Microsoft.Extensions.Logging.ILogger.

src/Tests/MicrosoftLogFactoryTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using System.Threading.Tasks;
2-
31
public class MicrosoftLogFactoryTests
42
{
53
[Test]

src/Tests/NamedLoggerTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using NServiceBus.Logging;
2-
using System.Threading.Tasks;
32

43
/// <summary>
54
/// Tests for the NamedLogger class that queues logs for deferred processing.

src/Tests/TestHelpers.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ public ILogger CreateLogger(string categoryName)
5454
{
5555
if (!Loggers.TryGetValue(categoryName, out var logger))
5656
{
57-
logger = new MockMsLogger { EnabledLevel = DefaultEnabledLevel };
57+
logger = new()
58+
{
59+
EnabledLevel = DefaultEnabledLevel
60+
};
5861
Loggers[categoryName] = logger;
5962
}
6063
return logger;

0 commit comments

Comments
 (0)