Skip to content

Commit

Permalink
Update test names and move into nested test class
Browse files Browse the repository at this point in the history
  • Loading branch information
BlazeFace committed Apr 13, 2024
1 parent f3d3a8c commit df2337c
Showing 1 changed file with 49 additions and 49 deletions.
98 changes: 49 additions & 49 deletions test/Spectre.Console.Cli.Tests/Unit/CommandAppTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,55 +160,6 @@ public void Should_Pass_Case_6()
});
}

[Fact]
public void Should_Pass_Case_7()
{
// Given
var app = new CommandAppTester();
app.Configure(cfg =>
{
cfg.AddBranch("a", d =>
{
d.AddDelegate("b", _ =>
{
AnsiConsole.MarkupLine("[red]Complete[/]");
return 0;
});
});
});

// When
var result = app.Run([
"a", "b"
]);

// Then
result.ExitCode.ShouldBe(0);
}

[Fact]
public void Should_Pass_Case_8()
{
// Given
var app = new CommandAppTester();
app.Configure(cfg =>
{
cfg.AddDelegate("a", _ =>
{
AnsiConsole.MarkupLine("[red]Complete[/]");
return 0;
});
});

// When
var result = app.Run([
"a"
]);

// Then
result.ExitCode.ShouldBe(0);
}

[Fact]
public void Should_Pass_Case_3()
{
Expand Down Expand Up @@ -1185,6 +1136,55 @@ public void Should_Execute_Delegate_Command_At_Root_Level()
data.ShouldBe(2);
}

[Fact]
public void Should_Execute_Nested_Delegate_Empty_Command()
{
// Given
var app = new CommandAppTester();
app.Configure(cfg =>
{
cfg.AddBranch("a", d =>
{
d.AddDelegate("b", _ =>
{
AnsiConsole.MarkupLine("[red]Complete[/]");
return 0;
});
});
});

// When
var result = app.Run([
"a", "b"
]);

// Then
result.ExitCode.ShouldBe(0);
}

[Fact]
public void Should_Execute_Delegate_Empty_Command_At_Root_Level()
{
// Given
var app = new CommandAppTester();
app.Configure(cfg =>
{
cfg.AddDelegate("a", _ =>
{
AnsiConsole.MarkupLine("[red]Complete[/]");
return 0;
});
});

// When
var result = app.Run([
"a"
]);

// Then
result.ExitCode.ShouldBe(0);
}

[Fact]
public async void Should_Execute_Async_Delegate_Command_At_Root_Level()
{
Expand Down

0 comments on commit df2337c

Please sign in to comment.