public void TestAddRecipe() { var recipe = new Recipe() { Name = "foo" }; var ingredient = new Ingredient() { Name = "Ingredient" }; recipe.AddRecipeIngredient(ingredient, 1, Units.oz); repo.Add(recipe); var result = repo.Get(recipe.Name); Assert.IsTrue(result.Count == 1); Assert.IsTrue(result[0].Name == recipe.Name); }
public void AddRecipe(RecipeDTO recipe, string currentUser) { Recipe dbRecipe = new Recipe() { Id = recipe.Id, Title = recipe.Title, ImageUrl = recipe.ImageUrl, DateCreated = DateTime.Now, Notes = recipe.Notes, CatId = recipe.CatId, //CatReference = (Category)recipe.Catetory, //MenuId = recipe.Menu.Id, UserId = _uRepo.getCurrentUser(currentUser).First().Id }; _rRepo.Add(dbRecipe); }