File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed
Serilog.Extensions.Logging.Benchmarks
Serilog.Extensions.Logging.Tests Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 12
12
<ItemGroup >
13
13
<PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 17.5.0" />
14
14
<PackageReference Include =" xunit.runner.visualstudio" Version =" 2.4.5" PrivateAssets =" All" />
15
- <PackageReference Include =" xunit" Version =" 2.4.2 " />
15
+ <PackageReference Include =" xunit" Version =" 2.5.1 " />
16
16
<PackageReference Include =" BenchmarkDotNet" Version =" 0.13.5" />
17
17
</ItemGroup >
18
18
Original file line number Diff line number Diff line change 4
4
<TargetFrameworks >net7.0;net472</TargetFrameworks >
5
5
<ImplicitUsings >enable</ImplicitUsings >
6
6
</PropertyGroup >
7
+
8
+ <PropertyGroup Condition =" '$(TargetFramework) == 'net472' " >
9
+ <DefineConstants >$(DefineConstants);FORCE_W3C_ACTIVITY_ID</DefineConstants >
10
+ </PropertyGroup >
7
11
8
12
<ItemGroup >
9
13
<ProjectReference Include =" ..\..\src\Serilog.Extensions.Logging\Serilog.Extensions.Logging.csproj" />
12
16
<ItemGroup >
13
17
<PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 17.5.0" />
14
18
<PackageReference Include =" xunit.runner.visualstudio" Version =" 2.4.5" PrivateAssets =" all" />
15
- <PackageReference Include =" xunit" Version =" 2.4.2 " />
19
+ <PackageReference Include =" xunit" Version =" 2.5.1 " />
16
20
<PackageReference Include =" Shouldly" Version =" 4.1.0" />
17
21
<PackageReference Include =" PublicApiGenerator" Version =" 11.0.0" />
18
22
</ItemGroup >
Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ public void LogsCorrectMessage()
143
143
144
144
Assert . Equal ( 3 , sink . Writes . Count ) ;
145
145
146
- Assert . Equal ( 1 , sink . Writes [ 0 ] . Properties . Count ) ;
146
+ Assert . Single ( sink . Writes [ 0 ] . Properties ) ;
147
147
Assert . Empty ( sink . Writes [ 0 ] . RenderMessage ( ) ) ;
148
148
149
149
Assert . Equal ( 2 , sink . Writes [ 1 ] . Properties . Count ) ;
@@ -501,6 +501,11 @@ public void Emit(LogEvent logEvent)
501
501
[ Fact ]
502
502
public void TraceAndSpanIdsAreCaptured ( )
503
503
{
504
+ #if FORCE_W3C_ACTIVITY_ID
505
+ Activity . DefaultIdFormat = ActivityIdFormat . W3C ;
506
+ Activity . ForceDefaultIdFormat = true ;
507
+ #endif
508
+
504
509
using var listener = new ActivityListener ( ) ;
505
510
listener . ShouldListenTo = _ => true ;
506
511
listener . Sample = ( ref ActivityCreationOptions < ActivityContext > _ ) => ActivitySamplingResult . AllData ;
You can’t perform that action at this time.
0 commit comments