From dc8214915acd115352a78a1dde800a02b6422e16 Mon Sep 17 00:00:00 2001 From: Roxane Date: Fri, 19 May 2023 19:17:34 +0200 Subject: [PATCH] Ingredient class finished and tested --- MCTG/ConsoleApp/Program.cs | 29 ++++------------------------- MCTG/ConsoleApp/Stub_Ingredient.cs | 20 ++++++++++++++++++++ MCTG/Model/Ingredient.cs | 2 +- MCTG/Model/Unit.cs | 2 +- 4 files changed, 26 insertions(+), 27 deletions(-) create mode 100644 MCTG/ConsoleApp/Stub_Ingredient.cs diff --git a/MCTG/ConsoleApp/Program.cs b/MCTG/ConsoleApp/Program.cs index c0760f0..818e4b9 100644 --- a/MCTG/ConsoleApp/Program.cs +++ b/MCTG/ConsoleApp/Program.cs @@ -1,32 +1,11 @@ using System; +using ConsoleApp; using Model; -namespace Program; +Stub_Ingredient stub = new Stub_Ingredient(); -public static class Program -{ - public static void Main() - { - Console.WriteLine("Helle World!"); +Ingredient ing = stub.testIngredient(); - Recipe recipe = new Recipe( - 1, - "Cookies aux pépites de chocolat", - new List(new string[]{ - "2 pommes", - "3L de vin", - "500g de farine" - }), - "Etape 1:\n" - + "\tCouper les pommes\n" - + "Etape 2:\n" - + "\tLes disposer sur le plat et mettre le vin dessus\n" - + "Etape 3:\n" - + "\tMettez toute la farine ensuite, puis 4h32 au four.\n" - + "\nDégustez c'est prêt !" - ); +Console.WriteLine(ing); - recipe.Display(); - } -} \ No newline at end of file diff --git a/MCTG/ConsoleApp/Stub_Ingredient.cs b/MCTG/ConsoleApp/Stub_Ingredient.cs new file mode 100644 index 0000000..6882276 --- /dev/null +++ b/MCTG/ConsoleApp/Stub_Ingredient.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Model; + +namespace ConsoleApp +{ + internal struct Stub_Ingredient + { + public Ingredient testIngredient() + { + Ingredient ingredient = new Ingredient("Patate", new Quantity(5, Unit.unit)); + return ingredient; + } + + + } +} diff --git a/MCTG/Model/Ingredient.cs b/MCTG/Model/Ingredient.cs index a63a2ec..46e5d36 100644 --- a/MCTG/Model/Ingredient.cs +++ b/MCTG/Model/Ingredient.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace Model { - internal class Ingredient + public class Ingredient { #region Attributes diff --git a/MCTG/Model/Unit.cs b/MCTG/Model/Unit.cs index 5e7d38c..b745126 100644 --- a/MCTG/Model/Unit.cs +++ b/MCTG/Model/Unit.cs @@ -11,5 +11,5 @@ namespace Model /// /// public enum Unit - { Unit, kG, mG, G, L, cL, mL }; + { unit, kG, mG, G, L, cL, mL }; }