Exemple #1
0
        public void ReturnInstanceOfCocktailIngredient_WithCocktailIdAsParameter()
        {
            var cocktailId   = 1;
            var ingredientId = 1;
            var quantity     = 1.0;

            var sut = new CocktailIngredientFactory();
            var cocktailIngredient = sut.Create(cocktailId, ingredientId, quantity);

            Assert.IsInstanceOfType(cocktailIngredient, typeof(CocktailIngredient));
            Assert.AreEqual(cocktailId, cocktailIngredient.CocktailId);
            Assert.AreEqual(ingredientId, cocktailIngredient.IngredientId);
            Assert.AreEqual(quantity, cocktailIngredient.Quatity);
        }
Exemple #2
0
        public void ReturnInstanceOfCocktailIngredient_WithCocktailAsParameter()
        {
            var cocktail = new Cocktail
            {
                Name      = "Name",
                ImagePath = "www.test.com"
            };

            var ingredientId = 1;
            var quantity     = 1.0;

            var sut = new CocktailIngredientFactory();
            var cocktailIngredient = sut.Create(cocktail, ingredientId, quantity);

            Assert.IsInstanceOfType(cocktailIngredient, typeof(CocktailIngredient));
            Assert.AreEqual("Name", cocktailIngredient.Cocktail.Name);
            Assert.AreEqual(ingredientId, cocktailIngredient.IngredientId);
            Assert.AreEqual(quantity, cocktailIngredient.Quatity);
        }