using Model; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DataPersistence { /// /// The subs class is a group of prefabricated object that can only be loaded. It only use is for testing. /// public class Stubs : IDataManager { public Dictionary> Load() { Dictionary> data = new Dictionary> { { #region Data: Recipes nameof(Recipe), new List(new[] { new Recipe( title: "Cookies classiques", picture : "room_service_icon.png", id: null, preparationSteps: new[] { new PreparationStep(1, "Faire cuire."), new PreparationStep(2, "Manger.") }), new Recipe( title: "Cookies au chocolat", picture : "", id: null, preparationSteps: new[] { new PreparationStep(1, "Moulinez la pâte."), new PreparationStep(2, "Faire cuire pendant une bonne heure."), new PreparationStep(3, "Sortir du four et mettre dans un plat.") }), new Recipe( title: "Gateau nature", picture : "dotnet_bot.svg", id: null, preparationSteps: new[] { new PreparationStep(1, "Achetez les ingrédients."), new PreparationStep(2, "Préparez le matériel. Ustensiles et tout."), new PreparationStep(3, "Pleurez.") }), new Recipe( title: "Gateau nature", picture : "dotnet_bot.svg", id: null, preparationSteps: new[] { new PreparationStep(1, "Achetez les ingrédients."), new PreparationStep(2, "Préparez le matériel. Ustensiles et tout."), new PreparationStep(3, "Pleurez.") }), new Recipe( title: "Gateau nature", picture : "dotnet_bot.svg", id: null, preparationSteps: new[] { new PreparationStep(1, "Achetez les ingrédients."), new PreparationStep(2, "Préparez le matériel. Ustensiles et tout."), new PreparationStep(3, "Pleurez.") }), new Recipe( title: "Dinde au jambon", picture : "", id: null, preparationSteps: new[] { new PreparationStep(1, "Faire une cuisson bien sec de la dinde à la poêle"), new PreparationStep(2, "Mettre la dinde au frigo."), new PreparationStep(3, "Mettre le jambon dans le micro-onde."), new PreparationStep(4, "Faire chauffer 3min."), new PreparationStep(5, "Présentez sur un plat la dinde et le jambon : Miam !") }), new Recipe( title: "Gateau nature", picture : "dotnet_bot.svg", id: null, preparationSteps: new[] { new PreparationStep(1, "Achetez les ingrédients."), new PreparationStep(2, "Préparez le matériel. Ustensiles et tout."), new PreparationStep(3, "Pleurez.") }), }) #endregion }, { #region Data: User nameof(User), new List(new[] { new User( name: "Admin", surname: "Admin", mail: "admin@mctg.fr", password: "admin"), new User( name: "Pedros", surname: "Amigos", mail: "pedrosamigos@hotmail.com", password: "pamigos") }) #endregion } }; return data; } #region Not supported methods public void Save(Dictionary> elements) { throw new NotSupportedException(); } public void Export(T obj, string pathToExport) where T : class { throw new NotSupportedException(); } public KeyValuePair Import(string pathToImport) where T : class { throw new NotSupportedException(); } #endregion } }