Esempio n. 1
0
        public void ShouldServerJuice_WhenJuiceIsSelected()
        {
            RecipeBook recipeBook = new RecipeBook(_consoleWriter);

            recipeBook.MakeRecipe("juice");
            Debug.Assert(_consoleWriter.GetOutputBuffer() == "Here you go! Fresh and nice juice.");
        }
Esempio n. 2
0
        public void ShouldNotInvokeAnyMethod_WhenInputIsInvalid(string input)
        {
            RecipeBook recipeBook = new RecipeBook(_consoleWriter);

            _consoleWriter.SetInputBuffer(input);
            recipeBook.MakeRecipe("beer");

            Debug.Assert(_consoleWriter.GetOutputBuffer() == "Input not valid");
        }
Esempio n. 3
0
        public void ShouldNotServerBeer_WhenClientIsBelow18()
        {
            RecipeBook recipeBook = new RecipeBook(_consoleWriter);

            _consoleWriter.SetInputBuffer("17");
            recipeBook.MakeRecipe("beer");

            Debug.Assert(_consoleWriter.GetOutputBuffer() == "Sorry but are not older to order a beer.");
        }
Esempio n. 4
0
        public void ShouldServerBeer_WhenClientIsAbove18()
        {
            RecipeBook recipeBook = new RecipeBook(_consoleWriter);

            _consoleWriter.SetInputBuffer("20");
            recipeBook.MakeRecipe("beer");

            Debug.Assert(_consoleWriter.GetOutputBuffer() == "Here you go! Cold beer.");
        }
Esempio n. 5
0
        public void ShouldThrownException_WhenInputAnInvalidDrink()
        {
            RecipeBook recipeBook = new RecipeBook(_consoleWriter);

            recipeBook.MakeRecipe("invalidDrink");
        }