Esempio n. 1
0
        public async Task TestPostRecipes()
        {
            // Arrange
            Recipe recipe = new Recipe
            {
                Author         = "author",
                Title          = "title",
                Type           = "type",
                body           = "body",
                Time           = 5,
                UpvoteCount    = 0,
                Ingredients    = "ingredients",
                Description    = "desc",
                AdditionalInfo = "addinfo"
            };

            // Act
            var result = await _recipeController.PostRecipe(recipe);

            var Ok_result_post_recipe    = result as OkObjectResult;
            var result_post_recipe_value = Ok_result_post_recipe.Value as Recipe;

            // Assert
            Assert.AreEqual("title", result_post_recipe_value.Title);
            Assert.IsNotNull(Ok_result_post_recipe);
            Assert.IsInstanceOfType(result, typeof(OkObjectResult));
        }