public bool Confirm(params char[] inputSequence)
        {
            if (!inputSequence.Any(input => input == 'Y' || input == 'n'))
            {
                Assert.Fail(@"Invalid input sequence for this test,
there needs to be a Y or n. Otherwise the the test will hang");
            }

            var consoleMock = new ConsoleMockBuilder()
                              .WithReadKeySequence(inputSequence)
                              .Build();

            var sut = new Confirm(consoleMock.Object);

            return(sut.Ask("Test Question??"));
        }
Beispiel #2
0
 public static bool Confirm(string message) => _confirm.Ask(message);