Skip to content

Commit

Permalink
Fix broken tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
nightblade9 committed Dec 18, 2024
1 parent 59c5821 commit adc58d1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public void ShowCreditsCommand_ReturnsTextBladeMessage()
var command = new ShowCreditsCommand(console);

// Act
command.Execute(null, null);
command.Execute(null);
var actual = console.LastMessage;

// Assert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public void Execute_ReturnsABunchOfCommands(string expectedCommand)
var console = new ConsoleStub();

// Act
new ShowHelpCommand(console).Execute(null, null);
new ShowHelpCommand(console).Execute(null);

// Assert
var expected = $"[{Colours.Command}]{expectedCommand}[/]".ToUpperInvariant();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using NUnit.Framework;
using TextBlade.Core.Characters;
using TextBlade.Core.Commands.Display;
using TextBlade.Core.IO;
using TextBlade.Core.Tests.Stubs;

namespace TextBlade.Core.Tests.Commands.Display;
Expand All @@ -22,7 +23,7 @@ public void Execute_ReportsHealthPerCharacter()
var command = new ShowPartyStatusCommand(console);

// Act
command.Execute(null, party);
command.Execute(new SaveData() { Party = party});

// Assert
Assert.That(console.Messages.Any(a => a.StartsWith("Party status")));
Expand Down
4 changes: 1 addition & 3 deletions source/TextBlade.Core/Commands/ICommand.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
using TextBlade.Core.Characters;
using TextBlade.Core.IO;

namespace TextBlade.Core.Commands;

public interface ICommand
{
/// <summary>
/// Execute a command. And return strings to run through console.
/// Everything else is here so we can act on it.
/// Execute a command. Passes in the latest save data.
/// </summary>
public void Execute(SaveData saveData);
}

0 comments on commit adc58d1

Please sign in to comment.