Skip to content

Commit 1c2b7a6

Browse files
seandgrimesfilipw
authored andcommitted
Fix broken ExitCommand unit test
The PromptsUserBeforeExiting() unit test was eternal looping since the Console.ReadLine() method was never stubbed to return a value
1 parent 919fdab commit 1c2b7a6

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

test/ScriptCs.Core.Tests/ReplCommands/ExitCommandTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public void PromptsUserBeforeExiting()
2828
// arrange
2929
const string message = "Are you sure you wish to exit? (y/n): ";
3030
var console = new Mock<IConsole>();
31+
console.Setup(x => x.ReadLine()).Returns("n");
3132
var executor = new Mock<IRepl>();
3233
var cmd = new ExitCommand(console.Object);
3334

0 commit comments

Comments
 (0)