-
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.
Unit tests for a couple of commands.
Fix a couple of unused-allocation issues.
- Loading branch information
1 parent
cf51049
commit 3ea72a6
Showing
4 changed files
with
42 additions
and
3 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
source/TextBlade.Core.Tests/Commands/DoNothingCommandTests.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using NUnit.Framework; | ||
using TextBlade.Core.Commands; | ||
|
||
namespace TextBlade.Core.Tests.Commands; | ||
|
||
[TestFixture] | ||
public class DoNothingCommandTests | ||
{ | ||
[Test] | ||
public void Execute_DoesNothing_Literally() | ||
{ | ||
// Arrange/Act/Assert | ||
Assert.That(new DoNothingCommand().Execute(null, null), Is.Empty); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
source/TextBlade.Core.Tests/Commands/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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using NUnit.Framework; | ||
using TextBlade.Core.Commands; | ||
|
||
namespace TextBlade.Core.Tests.Commands; | ||
|
||
[TestFixture] | ||
public class ShowHelpCommandTests | ||
{ | ||
[Test] | ||
public void Execute_ReturnsABunchOfCommands() | ||
{ | ||
// 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)); | ||
} | ||
} | ||
} |
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