Add global usings (#668)

* Use global usings

* Fix namespace declarations for test projects
This commit is contained in:
Patrik Svensson
2021-12-23 16:50:31 +01:00
committed by GitHub
parent eb6a9d8d04
commit 52c1d9122b
514 changed files with 10659 additions and 12441 deletions

View File

@@ -1,30 +1,25 @@
using System;
using System.Linq;
using Shouldly;
namespace Spectre.Console.Cli;
namespace Spectre.Console.Cli
public static class CommandContextExtensions
{
public static class CommandContextExtensions
public static void ShouldHaveRemainingArgument(this CommandContext context, string name, string[] values)
{
public static void ShouldHaveRemainingArgument(this CommandContext context, string name, string[] values)
if (context == null)
{
if (context == null)
{
throw new ArgumentNullException(nameof(context));
}
throw new ArgumentNullException(nameof(context));
}
if (values == null)
{
throw new ArgumentNullException(nameof(values));
}
if (values == null)
{
throw new ArgumentNullException(nameof(values));
}
context.Remaining.Parsed.Contains(name).ShouldBeTrue();
context.Remaining.Parsed[name].Count().ShouldBe(values.Length);
context.Remaining.Parsed.Contains(name).ShouldBeTrue();
context.Remaining.Parsed[name].Count().ShouldBe(values.Length);
foreach (var value in values)
{
context.Remaining.Parsed[name].ShouldContain(value);
}
foreach (var value in values)
{
context.Remaining.Parsed[name].ShouldContain(value);
}
}
}
}