update project structure

pull/55/head
Alexandre AGOSTINHO 2 years ago
parent 471db46fd8
commit 0001d567b0

@ -9,6 +9,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\DataPersistence\DataPersistence.csproj" /> <ProjectReference Include="..\DataPersistence\DataPersistence.csproj" />
<ProjectReference Include="..\FakePersistance\FakePersistance.csproj" />
<ProjectReference Include="..\Model\Model.csproj" /> <ProjectReference Include="..\Model\Model.csproj" />
</ItemGroup> </ItemGroup>

@ -2,6 +2,7 @@
using Model; using Model;
using DataPersistence; using DataPersistence;
using Model.Managers; using Model.Managers;
using FakePersistance;
Console.WriteLine("Hello, World!\n\n"); Console.WriteLine("Hello, World!\n\n");

@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Model\Model.csproj" />
</ItemGroup>
</Project>

@ -6,7 +6,7 @@ using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace DataPersistence namespace FakePersistance
{ {
/// <summary> /// <summary>
/// The subs class is a group of prefabricated object that can only be loaded. It only use is for testing. /// The subs class is a group of prefabricated object that can only be loaded. It only use is for testing.
@ -22,7 +22,7 @@ namespace DataPersistence
nameof(Recipe), nameof(Recipe),
new List<object>(new[] new List<object>(new[]
{ {
new Recipe("Cookies classiques", RecipeType.Dessert, null, "admin@mctg.fr", "") new Recipe("Cookies classiques", RecipeType.Dessert, Priority.Easy, null, "admin@mctg.fr", "")
{ {
Ingredients = new List<Ingredient> Ingredients = new List<Ingredient>
{ {
@ -42,7 +42,8 @@ namespace DataPersistence
}, },
new Recipe( new Recipe(
title: "Cookies au chocolat", title: "Cookies au chocolat",
type: RecipeType.Dessert) type: RecipeType.Dessert,
priority: Priority.Fast)
{ {
Ingredients = new List<Ingredient> Ingredients = new List<Ingredient>
{ {
@ -57,7 +58,8 @@ namespace DataPersistence
}, },
new Recipe( new Recipe(
title: "Gateau nature", title: "Gateau nature",
type: RecipeType.Dessert) type: RecipeType.Dessert,
priority: Priority.Gourmet)
{ {
Ingredients = new List<Ingredient> Ingredients = new List<Ingredient>
{ {
@ -77,7 +79,8 @@ namespace DataPersistence
}, },
new Recipe( new Recipe(
title: "Gateau au pommes", title: "Gateau au pommes",
type: RecipeType.Dessert) type: RecipeType.Dessert,
priority: Priority.Light)
{ {
PreparationSteps = new List<PreparationStep> PreparationSteps = new List<PreparationStep>
{ {
@ -90,6 +93,7 @@ namespace DataPersistence
new Recipe( new Recipe(
title: "Gateau au chocolat", title: "Gateau au chocolat",
type: RecipeType.Dessert, type: RecipeType.Dessert,
priority: Priority.Economic,
id: null, authorMail: "pedrosamigos@hotmail.com") id: null, authorMail: "pedrosamigos@hotmail.com")
{ {
Ingredients = new List<Ingredient> Ingredients = new List<Ingredient>
@ -110,6 +114,7 @@ namespace DataPersistence
new Recipe( new Recipe(
title: "Dinde au jambon", title: "Dinde au jambon",
type: RecipeType.Dish, type: RecipeType.Dish,
priority: Priority.Easy,
id: null, authorMail: "pedrosamigos@hotmail.com") id: null, authorMail: "pedrosamigos@hotmail.com")
{ {
Ingredients = new List<Ingredient> Ingredients = new List<Ingredient>
@ -130,6 +135,7 @@ namespace DataPersistence
new Recipe( new Recipe(
title: "Poulet au curry", title: "Poulet au curry",
type: RecipeType.Dish, type: RecipeType.Dish,
priority: Priority.Gourmet,
id: null, authorMail: "pedrosamigos@hotmail.com") id: null, authorMail: "pedrosamigos@hotmail.com")
{ {
Ingredients = new List<Ingredient> Ingredients = new List<Ingredient>

@ -7,4 +7,8 @@
<Configurations>Debug;Release;CI</Configurations> <Configurations>Debug;Release;CI</Configurations>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Exception\AppException.csproj" />
</ItemGroup>
</Project> </Project>

@ -52,6 +52,12 @@ namespace Model
} }
} }
/// <summary>
/// Priority of this recipe.
/// </summary>
[DataMember(Name = "priority")]
public Priority Priority { get; private set; }
/// <summary> /// <summary>
/// The Title of the recipe. <br/> /// The Title of the recipe. <br/>
/// Set to "No title." when the value passed is null, empty or contain white spaces. /// Set to "No title." when the value passed is null, empty or contain white spaces.
@ -110,13 +116,15 @@ namespace Model
/// </summary> /// </summary>
/// <param name="title">The title of the recipe</param> /// <param name="title">The title of the recipe</param>
/// <param name="type">The type of the recipe.</param> /// <param name="type">The type of the recipe.</param>
/// <param name="priority">The priority of this recipe.</param>
/// <param name="id">The id of the recipe. If not given, get a new id.</param> /// <param name="id">The id of the recipe. If not given, get a new id.</param>
/// <param name="authorMail">The name of the user that create this recipe.</param> /// <param name="authorMail">The name of the user that create this recipe.</param>
/// <param name="picture"> The image that represent the recipe</param> /// <param name="picture"> The image that represent the recipe</param>
public Recipe(string title, RecipeType type, int? id, string? authorMail, string? picture) public Recipe(string title, RecipeType type, Priority priority, int? id, string? authorMail, string? picture)
{ {
Title = title; Title = title;
Type = type; Type = type;
Priority = priority;
Image = picture; Image = picture;
AuthorMail = authorMail; AuthorMail = authorMail;
@ -134,18 +142,18 @@ namespace Model
else Id = (int)id; else Id = (int)id;
} }
public Recipe(string title, RecipeType type, int? id, string? authorMail) public Recipe(string title, RecipeType type, Priority priority, int? id, string? authorMail)
: this(title, type, id, authorMail, null) : this(title, type, priority, id, authorMail, null)
{ {
} }
public Recipe(string title, RecipeType type) public Recipe(string title, RecipeType type, Priority priority)
: this(title, type, null, null) : this(title, type, priority, null, null)
{ {
} }
public Recipe(string title) public Recipe(string title)
: this(title, RecipeType.Unspecified) : this(title, RecipeType.Unspecified, Priority.Fast)
{ {
} }
#endregion #endregion

@ -12,7 +12,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Model_UnitTests", "Tests\Mo
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{08B80CE8-A01D-4D86-8989-AF225D5DA48C}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{08B80CE8-A01D-4D86-8989-AF225D5DA48C}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataPersistence", "DataPersistence\DataPersistence.csproj", "{432F9D12-B1F7-4A79-8720-4971BB10B831}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataPersistence", "DataPersistence\DataPersistence.csproj", "{432F9D12-B1F7-4A79-8720-4971BB10B831}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Managers", "Managers\Managers.csproj", "{A3703A19-687C-4F63-A5DE-18E6D8995C77}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppException", "Exception\AppException.csproj", "{77E6BD97-B1E5-45F5-ABFB-9A1D985A8EDE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FakePersistance", "FakePersistance\FakePersistance.csproj", "{7C340CB2-8925-4BC4-9D8C-9058D9657F3F}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -42,6 +48,18 @@ Global
{432F9D12-B1F7-4A79-8720-4971BB10B831}.Debug|Any CPU.Build.0 = Debug|Any CPU {432F9D12-B1F7-4A79-8720-4971BB10B831}.Debug|Any CPU.Build.0 = Debug|Any CPU
{432F9D12-B1F7-4A79-8720-4971BB10B831}.Release|Any CPU.ActiveCfg = Release|Any CPU {432F9D12-B1F7-4A79-8720-4971BB10B831}.Release|Any CPU.ActiveCfg = Release|Any CPU
{432F9D12-B1F7-4A79-8720-4971BB10B831}.Release|Any CPU.Build.0 = Release|Any CPU {432F9D12-B1F7-4A79-8720-4971BB10B831}.Release|Any CPU.Build.0 = Release|Any CPU
{A3703A19-687C-4F63-A5DE-18E6D8995C77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A3703A19-687C-4F63-A5DE-18E6D8995C77}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A3703A19-687C-4F63-A5DE-18E6D8995C77}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A3703A19-687C-4F63-A5DE-18E6D8995C77}.Release|Any CPU.Build.0 = Release|Any CPU
{77E6BD97-B1E5-45F5-ABFB-9A1D985A8EDE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{77E6BD97-B1E5-45F5-ABFB-9A1D985A8EDE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{77E6BD97-B1E5-45F5-ABFB-9A1D985A8EDE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{77E6BD97-B1E5-45F5-ABFB-9A1D985A8EDE}.Release|Any CPU.Build.0 = Release|Any CPU
{7C340CB2-8925-4BC4-9D8C-9058D9657F3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7C340CB2-8925-4BC4-9D8C-9058D9657F3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7C340CB2-8925-4BC4-9D8C-9058D9657F3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7C340CB2-8925-4BC4-9D8C-9058D9657F3F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

Loading…
Cancel
Save