-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4637c4a
commit f5fb176
Showing
3 changed files
with
39 additions
and
27 deletions.
There are no files selected for viewing
20 changes: 12 additions & 8 deletions
20
source/TextBlade.Core.Tests/Commands/Display/ShowHelpCommandTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,28 @@ | ||
using NUnit.Framework; | ||
using TextBlade.Core.Commands.Display; | ||
using TextBlade.Core.IO; | ||
|
||
namespace TextBlade.Core.Tests.Commands.Display; | ||
|
||
[TestFixture] | ||
public class ShowHelpCommandTests | ||
{ | ||
[Test] | ||
public void Execute_ReturnsABunchOfCommands() | ||
[TestCase("credits")] | ||
[TestCase("help")] | ||
[TestCase("inv")] | ||
[TestCase("look")] | ||
[TestCase("party/status")] | ||
[TestCase("save")] | ||
[TestCase("quit")] | ||
public void Execute_ReturnsABunchOfCommands(string expectedCommand) | ||
{ | ||
// Arrange/Act | ||
var actuals = new ShowHelpCommand().Execute(null, null); | ||
|
||
// Assert | ||
// Check a bunch of commands | ||
foreach (var expectedCommand in new string[] {"credits", "help", "quit"}) | ||
{ | ||
var expected = $"[red]{expectedCommand}[/]".ToUpperInvariant(); | ||
var actual = actuals.Single(a => a.ToUpperInvariant().Contains(expected)); | ||
Assert.That(actual.ToUpperInvariant(), Does.Contain(expected)); | ||
} | ||
var expected = $"[{Colours.Command}]{expectedCommand}[/]".ToUpperInvariant(); | ||
var actual = actuals.Single(a => a.ToUpperInvariant().Contains(expected)); | ||
Assert.That(actual.ToUpperInvariant(), Does.Contain(expected)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters