示例#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.");
        }
示例#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");
        }
示例#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.");
        }
示例#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.");
        }
示例#5
0
        public void ShouldThrownException_WhenInputAnInvalidDrink()
        {
            RecipeBook recipeBook = new RecipeBook(_consoleWriter);

            recipeBook.MakeRecipe("invalidDrink");
        }