Skip to content
This repository was archived by the owner on Feb 22, 2026. It is now read-only.

Commit 5566ca0

Browse files
committed
Enable implicit usings in most projects
1 parent 7d833b4 commit 5566ca0

787 files changed

Lines changed: 25 additions & 2234 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/Directory.Build.props

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<DebugType Condition=" '$(TargetFrameworkIdentifier)' != '.NETFramework' ">embedded</DebugType>
1212
<DefineConstants>$(DefineConstants);XUNIT_NULLABLE;XUNIT_OVERLOAD_RESOLUTION_PRIORITY;XUNIT_POINTERS</DefineConstants>
1313
<DefineConstants Condition=" $(MSBuildProjectName.Contains('.aot')) ">$(DefineConstants);XUNIT_AOT</DefineConstants>
14+
<ImplicitUsings Condition=" '$(ImplicitUsings)' == '' ">true</ImplicitUsings>
1415
<IsAotCompatible Condition=" $(MSBuildProjectName.Contains('.aot')) ">true</IsAotCompatible>
1516
<LangVersion>14.0</LangVersion>
1617
<MSBuildCopyContentTransitively>false</MSBuildCopyContentTransitively>
@@ -22,6 +23,10 @@
2223
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
2324
</PropertyGroup>
2425

26+
<ItemGroup Condition=" '$(ImplicitUsings)' == 'true' ">
27+
<Using Include="System.Diagnostics.CodeAnalysis; System.Globalization; Xunit.Internal"/>
28+
</ItemGroup>
29+
2530
<ItemGroup>
2631
<PackageReference Include="Nerdbank.GitVersioning" Version="$(Nerdbank_GitVersioning_Version)">
2732
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

src/common.tests/Compilation/AcceptanceTestAssembly.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.IO;
4-
using System.Threading.Tasks;
5-
using Xunit.Internal;
6-
71
public abstract class AcceptanceTestAssembly :
82
IDisposable
93
{

src/common.tests/Extensions/EnumerableExtensions.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using System.Collections.Generic;
2-
31
public static class EnumerableExtensions
42
{
53
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously

src/common.tests/Extensions/MemoryExtensions.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using System;
2-
31
internal static class MemoryExtensions
42
{
53
public static Memory<T> Memoryify<T>(this T[]? values) =>

src/common.tests/Extensions/SetExtensions.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using System.Collections.Generic;
2-
31
internal static class SetExtensions
42
{
53
public static SortedSet<T> ToSortedSet<T>(

src/common.tests/Extensions/SpanExtensions.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using System;
2-
31
internal static class SpanExtensions
42
{
53
public static Span<T> Spanify<T>(this T[]? values) =>

src/common.tests/TestDoubles/SpyMessageSink.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Threading;
41
using Xunit.Sdk;
52

63
public class SpyMessageSink : IMessageSink

src/common.tests/TestDoubles/SpyRunnerLogger.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using System.Collections.Generic;
2-
31
namespace Xunit.Runner.Common;
42

53
public class SpyRunnerLogger : IRunnerLogger

src/common.tests/TestDoubles/SpyRunnerReporter.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#pragma warning disable xUnit3001 // This class is not created at runtime by the framework
22

3-
using System.Collections.Generic;
4-
using System.Threading.Tasks;
53
using Xunit.Sdk;
64

75
namespace Xunit.Runner.Common;

src/common.tests/TestDoubles/TestData.Messages.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using System;
2-
using System.Collections.Generic;
31
using Xunit.Runner.Common;
42
using Xunit.Sdk;
53

0 commit comments

Comments
 (0)