Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade xunit and SonarAnalyzer.CSharp packages #1151

Merged
merged 1 commit into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<!-- Shared code analyzers used for all projects in the solution -->
<ItemGroup Label="Code Analyzers">
<PackageReference Include="AsyncFixer" Version="1.6.0" PrivateAssets="All" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.4.0.72892" PrivateAssets="All" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.5.0.73987" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Label="Implicit usings"
Expand Down
4 changes: 2 additions & 2 deletions src/bunit.web.testcomponents/bunit.web.testcomponents.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<ItemGroup>
<PackageReference Include="SourceFileFinder" Version="1.1.0" />
<PackageReference Include="xunit.assert" Version="2.4.2" />
<PackageReference Include="xunit.extensibility.core" Version="2.4.2" />
<PackageReference Include="xunit.extensibility.execution" Version="2.4.2" />
<PackageReference Include="xunit.extensibility.core" Version="2.5.0" />
<PackageReference Include="xunit.extensibility.execution" Version="2.5.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
Expand Down
1 change: 1 addition & 0 deletions tests/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ dotnet_diagnostic.CA1849.severity = suggestion # CA1849: Call async methods whe
dotnet_diagnostic.xUnit1026.severity = none # xUnit1026: Theory methods should use all of their parameters
dotnet_diagnostic.S1144.severity = suggestion # S1144: Unused private types or members should be removed
dotnet_diagnostic.S2094.severity = suggestion # S2094: Classes should not be empty
dotnet_diagnostic.S6562.severity = suggestion # "Provide the "DateTimeKind" when creating this object.
14 changes: 2 additions & 12 deletions tests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,16 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="Shouldly" Version="4.2.1" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="Xunit.Combinatorial" Version="1.5.25" />
<PackageReference Include="coverlet.msbuild" Version="6.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<NoWarn>NU1701</NoWarn>
</PackageReference>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'netstandard2.1'">
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup Label="Implicit usings" Condition="$(MSBuildProjectName) != 'bunit.testassets' AND $(MSBuildProjectName) != 'AngleSharpWrappers.Tests'">
<Using Include="AutoFixture" />
<Using Include="AutoFixture.Xunit2" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,4 @@ public static void ShouldAllBe<T>(this IEnumerable<T> collection, params Action<
{
Assert.Collection(collection, elementInspectors);
}

/// <summary>
/// Verifies that a collection contains exactly a given number of elements, which
/// meet the criteria provided by the element inspectors.
/// </summary>
/// <param name="collection">The collection to be inspected.</param>
/// <param name="elementInspectors">The element inspectors, which inspect each element and its index in the collection in turn. The total number of element inspectors must exactly match the number of elements in the collection.</param>
public static void ShouldAllBe<T>(this IEnumerable<T> collection, params Action<T, int>[] elementInspectors)
{
T[] elements = collection.ToArray();
int expectedCount = elementInspectors.Length;
int actualCount = elements.Length;

if (expectedCount != actualCount)
throw new CollectionException(collection, expectedCount, actualCount);

for (int idx = 0; idx < actualCount; idx++)
{
try
{
elementInspectors[idx](elements[idx], idx);
}
catch (Exception ex)
{
throw new CollectionException(collection, expectedCount, actualCount, idx, ex);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="xunit.extensibility.core" Version="2.4.2" />
<PackageReference Include="xunit.extensibility.execution" Version="2.4.2" />
<PackageReference Include="xunit.runner.utility" Version="2.4.2" />
<PackageReference Update="Shouldly" Version="4.1.0">
<PackageReference Include="xunit.extensibility.core" Version="2.5.0" />
<PackageReference Include="xunit.extensibility.execution" Version="2.5.0" />
<PackageReference Include="xunit.runner.utility" Version="2.5.0" />
<PackageReference Update="Shouldly" Version="4.2.1">
<!-- some test fails with > 4.1.0 -->
<NoWarn>NU1605</NoWarn>
</PackageReference>
</PackageReference>
<PackageReference Update="SonarAnalyzer.CSharp" Version="9.5.0.73987" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion tests/bunit.web.tests/BlazorE2E/ComponentRenderingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ public void CanPatchRenderTreeToMatchLatestDOMState()
// because the diff algorithm explicitly unchecks it
cut.Find(".incomplete-items .item-isdone").Change(true);
var incompleteLIs = cut.FindAll(incompleteItemsSelector);
Assert.Equal(1, incompleteLIs.Count);
Assert.Single(incompleteLIs);
Assert.False(incompleteLIs[0].QuerySelector(".item-isdone").HasAttribute("checked"));

// Mark first done item as not done; observe the remaining complete item appears checked
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public async Task Test001()

// assert
Assert.NotNull(policy);
Assert.Equal(0, policy.AuthenticationSchemes.Count);
Assert.Equal(1, policy.Requirements.Count);
Assert.Empty(policy.AuthenticationSchemes);
Assert.Single(policy.Requirements);
Assert.IsType<DenyAnonymousAuthorizationRequirement>(policy.Requirements[0]);
}

Expand Down
Loading