public void PromptForSize_UserSelectsValidOption_ReturnsUserInput(string fakeInput, string expectedResponse) { TestCoffee testCoffee = new TestCoffee(new CoffeeMenu(), fakeInput); var result = testCoffee.PromptForSize(); Assert.That(result == expectedResponse); }
//[TestCase("-1")] //[TestCase("garbage")] //[TestCase("4")] public void PromptForAddIn_UserSelectsCreamAndInvalidNumberOption_ShouldBeInfiniteLoop() { string fakeInput = "-1"; TestCoffee testCoffee = new TestCoffee(new CoffeeMenu(), fakeInput); Task t = Task.Run(() => testCoffee.PromptForSize()); Thread.Sleep(5000); }
public void PromptForAddIn_UserSelectsCreamAndValidNumberOption_ReturnsUserInput() { string fakeInput = "0"; TestCoffee testCoffee = new TestCoffee(new CoffeeMenu(), fakeInput); var result = testCoffee.PromptForSize(); Assert.That(result == 0.ToString()); }
public void PromptForSize_UserSelectsInvalidOption_ShouldBeInfiniteLoop() { string fakeInput = "garbage"; TestCoffee testCoffee = new TestCoffee(new CoffeeMenu(), fakeInput); Task t = Task.Run(() => testCoffee.PromptForSize()); Thread.Sleep(5000); }