public void AddRecipeToDatabaseTest() { //Arrange // - Fake Recipe Recipe r = new Recipe(); r.CookTimeInMinutes = 10; r.Description = "FAKE DESCRIPTION"; r.Instructions = "FAKE INSTRUCTIONS"; r.Name = "FAKE NAME"; // - DAL to Insert the Fake Recipe RecipeDAL dal = new RecipeDAL(connectionString); //Act // - Call AddRecipe using the Fake Recipe bool output = dal.AddRecipe(r); //Assert // - Validatea that AddRecipe returned TRUE Assert.IsTrue(output); }
private void AddARecipe() { string name = CLIHelper.GetString("NAME OF RECIPE: "); string description = CLIHelper.GetString("DESCRIPTION: "); string instructions = CLIHelper.GetString("INSTRUCTIONS: "); int cookTime = CLIHelper.GetInteger("How long does it take to cook"); Recipe r = new Recipe(); r.Name = name; r.Description = description; r.Instructions = instructions; r.CookTimeInMinutes = cookTime; RecipeDAL dal = new RecipeDAL(connectionString); dal.AddRecipe(r); Console.WriteLine("Sucessfully added!"); Console.ReadLine(); }