Exemplo n.º 1
0
        public void PromptForSize_UserSelectsValidOption_ReturnsUserInput(string fakeInput, string expectedResponse)
        {
            TestCoffee testCoffee = new TestCoffee(new CoffeeMenu(), fakeInput);

            var result = testCoffee.PromptForSize();

            Assert.That(result == expectedResponse);
        }
Exemplo n.º 2
0
        //[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);
        }
Exemplo n.º 3
0
        public void PromptForAddIn_UserSelectsCreamAndValidNumberOption_ReturnsUserInput()
        {
            string fakeInput = "0";

            TestCoffee testCoffee = new TestCoffee(new CoffeeMenu(), fakeInput);

            var result = testCoffee.PromptForSize();

            Assert.That(result == 0.ToString());
        }
Exemplo n.º 4
0
        public void PromptForSize_UserSelectsInvalidOption_ShouldBeInfiniteLoop()
        {
            string fakeInput = "garbage";

            TestCoffee testCoffee = new TestCoffee(new CoffeeMenu(), fakeInput);

            Task t = Task.Run(() => testCoffee.PromptForSize());

            Thread.Sleep(5000);
        }