diff --git a/Webzine.Entity/Fixtures/DataFactory.cs b/Webzine.Entity/Fixtures/DataFactory.cs new file mode 100644 index 0000000..5199a8a --- /dev/null +++ b/Webzine.Entity/Fixtures/DataFactory.cs @@ -0,0 +1,186 @@ +namespace Webzine.Entity.Fixtures; + +using Entity; +using Faker; +using System; +using System.Collections.Generic; +using System.Linq; + +public class DataFactory +{ + /// + /// Dictionnaire contenant des données de musique réelles pour les titres générés. + /// + public Dictionary RealMusicData { get; set; } + = new Dictionary + { + { "juliana_chahayed_1", ("https://open.spotify.com/intl-fr/track/0qYLUdJQMhrCFA9dNZGcnm?si=b4fd45727a354a31", + "https://i.scdn.co/image/ab67616d0000b2738e8e7b8f8f8f8f8f8f8f8f8") }, + + { "mister_v_1", ("https://youtu.be/JeqUw7sGUK8?si=FnmFR2EgkVY6MhqQ", + "https://img.youtube.com/vi/JeqUw7sGUK8/maxresdefault.jpg") }, + + { "compagnie_creole_1", ("https://youtu.be/wfxt1SGWAI8", + "https://img.youtube.com/vi/wfxt1SGWAI8/maxresdefault.jpg") }, + + { "femto_1", ("https://open.spotify.com/intl-fr/track/0qYLUdJQMhrCFA9dNZGcnm?si=b4fd45727a354a31", + "https://i.scdn.co/image/ab67616d0000b2738e8e7b8f8f8f8f8f8f8f8f8") }, + + { "chat_noir_1", ("https://youtu.be/OTi4-q-_Tj0?si=SNnLd-6Y893nL5Au", + "https://img.youtube.com/vi/OTi4-q-_Tj0/maxresdefault.jpg") }, + + { "chat_noir_2", ("https://youtu.be/X-rJ01EyiAI?si=gH9m_U8oXI35OgWu", + "https://img.youtube.com/vi/X-rJ01EyiAI/maxresdefault.jpg") }, + + { "chat_noir_3", ("https://youtu.be/7lIM0wSx7kQ?si=S-RAsLzd4SiCQhE4", + "https://img.youtube.com/vi/7lIM0wSx7kQ/maxresdefault.jpg") }, + + { "chat_noir_4", ("https://youtu.be/dbxyKR1P8vA?si=aRzdYBhwvKptV8Ff", + "https://img.youtube.com/vi/dbxyKR1P8vA/maxresdefault.jpg") }, + + { "chat_noir_5", ("https://youtu.be/DDHvKo5NnII?si=NFRkdVQL2mELP0yn", + "https://img.youtube.com/vi/DDHvKo5NnII/maxresdefault.jpg") }, + + { "chat_noir_6", ("https://youtu.be/J9LgHNf2Qy0?si=YGO1ggiLkefa9901", + "https://img.youtube.com/vi/J9LgHNf2Qy0/maxresdefault.jpg") }, + + { "chat_noir_7", ("https://youtu.be/oadhHk2xs6c?si=mbnJCA6SGsoYXnUK", + "https://img.youtube.com/vi/oadhHk2xs6c/maxresdefault.jpg") }, + + { "chat_noir_8", ("https://youtu.be/6K1zCgkBaoE?si=quq9vQLJ-AmzjRJJ", + "https://img.youtube.com/vi/6K1zCgkBaoE/maxresdefault.jpg") }, + + { "german_rapper_1", ("https://www.youtube.com/watch?v=DWpg71HJt24", + "https://img.youtube.com/vi/DWpg71HJt24/maxresdefault.jpg") }, + + { "nizard_1", ("https://youtu.be/1fjA68k8DAU?si=2PuZSquVQGvfmQkZ", + "https://img.youtube.com/vi/1fjA68k8DAU/maxresdefault.jpg") }, + }; + + public List GenerateArtists(int count) + { + var artists = new List(); + + for (int i = 0; i < count; i++) + { + artists.Add(new Artiste + { + IdArtiste = i + 1, + Nom = Name.FullName(), + Biographie = Lorem.Paragraph(), + Titres = new List() + }); + } + + return artists; + } + + /// + /// Génère une liste de styles de musique à partir d'une liste prédéfinie de noms de styles. + /// + /// Nombre de styles à générer (maximum 15, car il y a 15 styles prédéfinis) + /// Liste de styles de musique générés + public List