Skip to content

Commit

Permalink
Update all dependencies, fix new xUnit lints
Browse files Browse the repository at this point in the history
  • Loading branch information
nblumhardt committed May 28, 2024
1 parent 9fcf795 commit 5e18faf
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 27 deletions.
4 changes: 2 additions & 2 deletions src/Serilog/Serilog.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
<ItemGroup>
<None Include="../../assets/icon.png" Pack="true" Visible="false" PackagePath="/" />
<None Include="../../README.md" Pack="true" Visible="false" PackagePath="/" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="PolySharp" Version="1.12.1" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="PolySharp" Version="1.14.1" PrivateAssets="All" />
<EmbeddedResource Include="ILLink.Substitutions.xml">
<LogicalName>ILLink.Substitutions.xml</LogicalName>
</EmbeddedResource>
Expand Down
10 changes: 5 additions & 5 deletions test/Serilog.ApprovalTests/Serilog.ApprovalTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" PrivateAssets="all" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="Shouldly" Version="4.1.0" />
<PackageReference Include="PublicApiGenerator" Version="11.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1" PrivateAssets="all" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="Shouldly" Version="4.2.1" />
<PackageReference Include="PublicApiGenerator" Version="11.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions test/Serilog.PerformanceTests/Serilog.PerformanceTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="PolySharp" Version="1.12.1" PrivateAssets="All" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" PrivateAssets="all" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.5" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1" PrivateAssets="all" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions test/Serilog.Tests/Capturing/PropertyValueConverterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public void ByDefaultAScalarDictionaryIsADictionaryValue()
var pv = _converter.CreatePropertyValue(new Dictionary<int, string> { { 1, "hello" } }, Destructuring.Default);
Assert.IsType<DictionaryValue>(pv);
var dv = (DictionaryValue)pv;
Assert.Equal(1, dv.Elements.Count);
Assert.Single(dv.Elements);
}

[Fact]
Expand All @@ -153,7 +153,7 @@ public void ByDefaultANonScalarDictionaryIsASequenceValue()
var pv = _converter.CreatePropertyValue(new Dictionary<A, string> { { new A(), "hello" } }, Destructuring.Default);
Assert.IsType<SequenceValue>(pv);
var sv = (SequenceValue)pv;
Assert.Equal(1, sv.Elements.Count);
Assert.Single(sv.Elements);
}

[Fact]
Expand Down Expand Up @@ -312,7 +312,7 @@ public void IndexerPropertiesAreIgnoredWhenDestructuring()
{
var indexed = new HasIndexer();
var pv = (StructureValue)_converter.CreatePropertyValue(indexed, true);
Assert.Equal(0, pv.Properties.Count);
Assert.Empty(pv.Properties);
}

// Important because we use "Item" to short cut indexer checking
Expand Down
4 changes: 2 additions & 2 deletions test/Serilog.Tests/Formatting/Json/JsonValueFormatterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public class JsonValueFormatterTests
{
class JsonLiteralValueFormatter : JsonValueFormatter
{
public string Format(object literal)
public string Format(object? literal)
{
var output = new StringWriter();
FormatLiteralValue(literal, output);
Expand Down Expand Up @@ -32,7 +32,7 @@ public string Format(object literal)
[InlineData("a\nb", "\"a\\nb\"")]
[InlineData("", "\"\"")]
[InlineData(null, "null")]
public void JsonLiteralTypesAreFormatted(object value, string expectedJson)
public void JsonLiteralTypesAreFormatted(object? value, string expectedJson)
{
var formatter = new JsonLiteralValueFormatter();
Assert.Equal(expectedJson, formatter.Format(value));
Expand Down
4 changes: 2 additions & 2 deletions test/Serilog.Tests/MethodOverloadConventionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public void ValidateForContextMethods(Type loggerType)
}
else
{
report.AppendLine($"{testMethod.Name} Invocation Failure on: {method} with: {xunitException.UserMessage}");
report.AppendLine($"{testMethod.Name} Invocation Failure on: {method} with: {xunitException.Message}");
}
}
}
Expand Down Expand Up @@ -733,7 +733,7 @@ void ValidateConventionForMethodSet(
}
else
{
report.AppendLine($"{testMethod.Name} Invocation Failure on: {method} with: {xunitException.UserMessage}");
report.AppendLine($"{testMethod.Name} Invocation Failure on: {method} with: {xunitException.Message}");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class MessageTemplateRendererTests
[InlineData("{Number:X8}", null, "00000010")]
[InlineData("{Number}", "j", "16")]
[InlineData("{Number:X8}", "j", "00000010")]
public void PropertyTokenFormatsAreApplied(string template, string appliedFormat, string expected)
public void PropertyTokenFormatsAreApplied(string template, string? appliedFormat, string expected)
{
var eventTemplate = _messageTemplateParser.Parse(template);
var properties = new Dictionary<string, LogEventPropertyValue> { ["Number"] = new ScalarValue(16) };
Expand Down
25 changes: 19 additions & 6 deletions test/Serilog.Tests/Serilog.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,28 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="System.ServiceModel.Http" Version="4.10.0" />
<PackageReference Include="System.ServiceModel.Primitives" Version="4.10.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" PrivateAssets="all" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1" PrivateAssets="all" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'net48' ">
<PackageReference Include="System.ServiceModel.Http" Version="4.10.3" />
<PackageReference Include="System.ServiceModel.Primitives" Version="4.10.3" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' or '$(TargetFramework)' == 'net7.0' ">
<PackageReference Include="System.ServiceModel.Http" Version="6.2.0" />
<PackageReference Include="System.ServiceModel.Primitives" Version="6.2.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="System.ServiceModel.Http" Version="8.0.0" />
<PackageReference Include="System.ServiceModel.Primitives" Version="8.0.0" />
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net462' ">
<DefineConstants>$(DefineConstants);TEST_FEATURE_APPDOMAIN</DefineConstants>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void TimeSpanValuesCanBeParsed(string input, int expDays, int expHours, i
// a full-qualified type name should not be considered a static member accessor
[InlineData("My.NameSpace.Class, MyAssembly, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
null, null)]
public void TryParseStaticMemberAccessorReturnsExpectedResults(string input, string expectedAccessorType, string expectedPropertyName)
public void TryParseStaticMemberAccessorReturnsExpectedResults(string input, string? expectedAccessorType, string? expectedPropertyName)
{
var actual = SettingValueConversions.TryParseStaticMemberAccessor(input,
out var actualAccessorType,
Expand Down
2 changes: 1 addition & 1 deletion test/TestDummies/TestDummies.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="PolySharp" Version="1.12.1" PrivateAssets="All" />
<PackageReference Include="PolySharp" Version="1.14.1" PrivateAssets="All" />
<ProjectReference Include="..\..\src\Serilog\Serilog.csproj" />
</ItemGroup>

Expand Down

0 comments on commit 5e18faf

Please sign in to comment.