Skip to content

Commit

Permalink
Bump xunit: 2.5.0->2.6.2
Browse files Browse the repository at this point in the history
And fix xUnit1012
  • Loading branch information
AndreyAkinshin committed Nov 26, 2023
1 parent 2e62b9b commit 92fa3f8
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<ItemGroup>
<!-- Microsoft.NET.Test.Sdk breaks netcoreapp2.0 -->
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.3" Condition=" '$(TargetFramework)' != 'netcoreapp2.0' " />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public JitRuntimeValidationTest(ITestOutputHelper output) : base(output) { }
[InlineData(Jit.LegacyJit, Platform.X64, null)]
[InlineData(Jit.RyuJit, Platform.X86, RyuJitNotAvailable)]
[InlineData(Jit.RyuJit, Platform.X64, null)]
public void CheckClrOnWindows(Jit jit, Platform platform, string errorMessage)
public void CheckClrOnWindows(Jit jit, Platform platform, string? errorMessage)
{
Verify(ClrRuntime.Net462, jit, platform, errorMessage);
}
Expand Down Expand Up @@ -54,7 +54,7 @@ public void CheckCore(Jit jit, Platform platform, string errorMessage)
Verify(CoreRuntime.Core80, jit, platform, errorMessage);
}

private void Verify(Runtime runtime, Jit jit, Platform platform, string errorMessage)
private void Verify(Runtime runtime, Jit jit, Platform platform, string? errorMessage)
{
var logger = new OutputLogger(Output);
var config = ManualConfig.CreateEmpty()
Expand Down
2 changes: 1 addition & 1 deletion tests/BenchmarkDotNet.Tests/BenchmarkDotNet.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />
<PackageReference Include="Verify.Xunit" Version="20.3.2" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void IntelCoreMicroarchitecture(string modelNumber, string microarchitect
[Theory]
[InlineData("", "Unknown processor")]
[InlineData(null, "Unknown processor")]
public void UnknownProcessorDoesNotThrow(string originalName, string prettifiedName)
public void UnknownProcessorDoesNotThrow(string? originalName, string prettifiedName)
{
var cpuInfo = new CpuInfo(originalName, nominalFrequency: null);

Expand Down
6 changes: 3 additions & 3 deletions tests/BenchmarkDotNet.Tests/Exporters/XmlSerializerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void CtorThrowsWhenParameterIsNull()
[InlineData(null, typeof(ArgumentException))]
[InlineData(" ", typeof(ArgumentException))]
[InlineData("", typeof(ArgumentException))]
public void WithRootNameThrowsGivenNameIsNullOrWhiteSpace(string name, Type exception)
public void WithRootNameThrowsGivenNameIsNullOrWhiteSpace(string? name, Type exception)
{
Assert.Throws(exception, () => XmlSerializer.GetBuilder(typeof(MockSource))
.WithRootName(name)
Expand All @@ -116,7 +116,7 @@ public void WithRootNameThrowsGivenNameIsNullOrWhiteSpace(string name, Type exce
[InlineData(null, "MockItem", typeof(ArgumentException))]
[InlineData(" ", "MockItem", typeof(ArgumentException))]
[InlineData("", "MockItem", typeof(ArgumentException))]
public void WithCollectionItemNameThrowsGivenInvalidArguments(string collectionName, string itemName, Type exception)
public void WithCollectionItemNameThrowsGivenInvalidArguments(string? collectionName, string? itemName, Type exception)
{
Assert.Throws(exception, () => XmlSerializer.GetBuilder(typeof(MockSource))
.WithCollectionItemName(collectionName, itemName)
Expand All @@ -127,7 +127,7 @@ public void WithCollectionItemNameThrowsGivenInvalidArguments(string collectionN
[InlineData(null, typeof(ArgumentException))]
[InlineData(" ", typeof(ArgumentException))]
[InlineData("", typeof(ArgumentException))]
public void WithExcludedPropertyThrowsGivenNameIsNullOrWhiteSpace(string name, Type exception)
public void WithExcludedPropertyThrowsGivenNameIsNullOrWhiteSpace(string? name, Type exception)
{
Assert.Throws(exception, () => XmlSerializer.GetBuilder(typeof(MockSource))
.WithExcludedProperty(name)
Expand Down
2 changes: 1 addition & 1 deletion tests/BenchmarkDotNet.Tests/Portability/HyperVTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void ContainsCorrectName()
[InlineData("Dell", "ubuntu", false)]
[InlineData("microsoft corporation", null, false)]
[InlineData(null, "virtual machine", false)]
public void DetectsVirtualMachine(string manufacturer, string model, bool expectedResult)
public void DetectsVirtualMachine(string? manufacturer, string? model, bool expectedResult)
{
bool result = hypervisor.IsVirtualMachine(manufacturer, model);
Assert.Equal(expectedResult, result);
Expand Down
2 changes: 1 addition & 1 deletion tests/BenchmarkDotNet.Tests/Portability/VMWareTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void ContainsCorrectName()
[InlineData(null, "vmWare", true)]
[InlineData("VMWare Inc", "redundant", false)]
[InlineData("VMWare Inc", null, false)]
public void DetectsVirtualMachine(string manufacturer, string model, bool expectedResult)
public void DetectsVirtualMachine(string? manufacturer, string? model, bool expectedResult)
{
bool result = hypervisor.IsVirtualMachine(manufacturer, model);
Assert.Equal(expectedResult, result);
Expand Down
2 changes: 1 addition & 1 deletion tests/BenchmarkDotNet.Tests/Portability/VirtualBoxTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public void ContainsCorrectName()
[InlineData("redundant", "VirtualBox", true)]
[InlineData("redundant", "vmware", false)]
[InlineData("redundant", null, false)]
public void DetectsVirtualMachine(string manufacturer, string model, bool expectedResult)
public void DetectsVirtualMachine(string manufacturer, string? model, bool expectedResult)
{
bool result = hypervisor.IsVirtualMachine(manufacturer, model);
Assert.Equal(expectedResult, result);
Expand Down
4 changes: 2 additions & 2 deletions tests/BenchmarkDotNet.Tests/RuntimeVersionDetectionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void TryGetVersionFromFrameworkNameHandlesValidInput(string frameworkName
[InlineData("")]
[InlineData(".NETCoreApp,Version=v")]
[InlineData("just wrong")]
public void TryGetVersionFromFrameworkNameHandlesInvalidInput(string frameworkName)
public void TryGetVersionFromFrameworkNameHandlesInvalidInput(string? frameworkName)
{
Assert.False(CoreRuntime.TryGetVersionFromFrameworkName(frameworkName, out _));
}
Expand All @@ -60,7 +60,7 @@ public void TryGetVersionFromProductInfoHandlesValidInput(RuntimeMoniker expecte
[InlineData("", "")]
[InlineData("not", "ok")]
[InlineData("Microsoft .NET Framework", "4.6.26614.01 @BuiltBy: dlab14-DDVSOWINAGE018 @Commit: a536e7eec55c538c94639cefe295aa672996bf9b")] // this is an actual output for 2.0 but it simply does not contain enough info
public void TryGetVersionFromProductInfoHandlesInvalidInput(string productName, string productVersion)
public void TryGetVersionFromProductInfoHandlesInvalidInput(string? productName, string? productVersion)
{
Assert.False(CoreRuntime.TryGetVersionFromProductInfo(productVersion, productName, out _));
}
Expand Down
2 changes: 1 addition & 1 deletion tests/BenchmarkDotNet.Tests/SourceCodeHelperTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class SourceCodeHelperTests
[InlineData(0.123f, "0.123f")]
[InlineData(0.123d, "0.123d")]
[InlineData(BindingFlags.Public, "(System.Reflection.BindingFlags)(16)")]
public void ToSourceCodeSimpleTest(object original, string expected)
public void ToSourceCodeSimpleTest(object? original, string expected)
{
string actual = SourceCodeHelper.ToSourceCode(original);
output.WriteLine("ORIGINAL : " + original + " (" + original?.GetType() + ")");
Expand Down
4 changes: 2 additions & 2 deletions tests/BenchmarkDotNet.Tests/StringExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void HtmlEncodeCharacters()
[InlineData(" a ", " a")]
[InlineData(" a ", " a")]
[InlineData(" \r\n a \r\n", " a")]
public void AppendArgumentMakesSureOneSpaceBeforeStringArgument(string input, string expectedOutput)
public void AppendArgumentMakesSureOneSpaceBeforeStringArgument(string? input, string expectedOutput)
{
var stringBuilder = new StringBuilder();
var result = stringBuilder.AppendArgument(input).ToString();
Expand All @@ -58,7 +58,7 @@ public void AppendArgumentMakesSureOneSpaceBeforeStringArgument(string input, st
[InlineData("http://test.com/ ", " http://test.com/")]
[InlineData(" http://test.com/ ", " http://test.com/")]
[InlineData("\r\n http://test.com/ \r\n", " http://test.com/")]
public void AppendArgumentMakesSureOneSpaceBeforeObjectArgument(string input, string expectedOutput)
public void AppendArgumentMakesSureOneSpaceBeforeObjectArgument(string? input, string expectedOutput)
{
Uri uri = input != null ? new Uri(input) : null; // Use Uri for our object type since that is what is used in code
var stringBuilder = new StringBuilder();
Expand Down

0 comments on commit 92fa3f8

Please sign in to comment.