mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-07-06 04:28:15 +08:00
Add global usings (#668)
* Use global usings * Fix namespace declarations for test projects
This commit is contained in:
@ -1,6 +1,3 @@
|
||||
using System;
|
||||
using Spectre.Console.Cli;
|
||||
|
||||
namespace Spectre.Console.Testing;
|
||||
|
||||
/// <summary>
|
||||
@ -24,4 +21,4 @@ public sealed class CallbackCommandInterceptor : ICommandInterceptor
|
||||
{
|
||||
_callback(context, settings);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,3 @@
|
||||
using System;
|
||||
using Spectre.Console.Cli;
|
||||
|
||||
namespace Spectre.Console.Testing;
|
||||
|
||||
/// <summary>
|
||||
@ -25,4 +22,4 @@ public sealed class CommandAppFailure
|
||||
.TrimLines()
|
||||
.Trim();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,5 +1,3 @@
|
||||
using Spectre.Console.Cli;
|
||||
|
||||
namespace Spectre.Console.Testing;
|
||||
|
||||
/// <summary>
|
||||
@ -39,4 +37,4 @@ public sealed class CommandAppResult
|
||||
.TrimLines()
|
||||
.Trim();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,3 @@
|
||||
using System;
|
||||
using Spectre.Console.Cli;
|
||||
|
||||
namespace Spectre.Console.Testing;
|
||||
|
||||
/// <summary>
|
||||
@ -131,4 +128,4 @@ public sealed class CommandAppTester
|
||||
|
||||
return new CommandAppResult(result, output, context, settings);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,3 @@
|
||||
using System;
|
||||
using Spectre.Console.Cli;
|
||||
|
||||
namespace Spectre.Console.Testing;
|
||||
|
||||
/// <summary>
|
||||
@ -187,4 +184,4 @@ public sealed class TypeRegistrarBaseTests
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,5 +1,3 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Spectre.Console.Testing;
|
||||
|
||||
/// <summary>
|
||||
@ -43,4 +41,4 @@ public static class StringExtensions
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
@ -21,4 +21,4 @@ public static class StyleExtensions
|
||||
|
||||
return style.Background(color);
|
||||
}
|
||||
}
|
||||
}
|
@ -13,4 +13,4 @@ internal sealed class NoopCursor : IAnsiConsoleCursor
|
||||
public void Show(bool show)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,3 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Spectre.Console.Testing;
|
||||
|
||||
internal sealed class NoopExclusivityMode : IExclusivityMode
|
||||
@ -14,4 +11,4 @@ internal sealed class NoopExclusivityMode : IExclusivityMode
|
||||
{
|
||||
return await func().ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
7
src/Spectre.Console.Testing/Properties/Usings.cs
Normal file
7
src/Spectre.Console.Testing/Properties/Usings.cs
Normal file
@ -0,0 +1,7 @@
|
||||
global using System;
|
||||
global using System.Collections.Generic;
|
||||
global using System.IO;
|
||||
global using System.Threading;
|
||||
global using System.Threading.Tasks;
|
||||
global using Spectre.Console.Cli;
|
||||
global using Spectre.Console.Rendering;
|
@ -17,8 +17,4 @@
|
||||
<ProjectReference Include="..\Spectre.Console\Spectre.Console.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Properties\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -1,5 +1,3 @@
|
||||
using Spectre.Console.Rendering;
|
||||
|
||||
namespace Spectre.Console.Testing;
|
||||
|
||||
/// <summary>
|
||||
@ -36,4 +34,4 @@ public sealed class TestCapabilities : IReadOnlyCapabilities
|
||||
{
|
||||
return new RenderContext(this);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,8 +1,3 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Spectre.Console.Rendering;
|
||||
|
||||
namespace Spectre.Console.Testing;
|
||||
|
||||
/// <summary>
|
||||
@ -118,4 +113,4 @@ public sealed class TestConsole : IAnsiConsole, IDisposable
|
||||
{
|
||||
_cursor = cursor;
|
||||
}
|
||||
}
|
||||
}
|
@ -63,4 +63,4 @@ public static class TestConsoleExtensions
|
||||
console.EmitAnsiSequences = true;
|
||||
return console;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,8 +1,3 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Spectre.Console.Testing;
|
||||
|
||||
/// <summary>
|
||||
@ -88,4 +83,4 @@ public sealed class TestConsoleInput : IAnsiConsoleInput
|
||||
{
|
||||
return Task.FromResult(ReadKey(intercept));
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user