//
// Copyright (c) PlaceholderCompany. All rights reserved.
//
using Bogus;
namespace Webzine.Entity.Fixtures
{
public class CommentaireFactory
{
///
/// Seeder pour la base de données.
///
/// Titre.
/// Min.
/// Max.
/// Liste de commentaire.
public static List CreerListeCommentaire(Titre titre, int min = 0, int max = 5)
{
Random random = new Random();
int count = random.Next(min, max + 1);
Faker faker = new Faker("fr")
.RuleFor(c => c.Auteur, f => f.Internet.UserName())
.RuleFor(c => c.Contenu, f => f.Lorem.Sentences(2))
.RuleFor(c => c.DateCreation, f => f.Date.Recent(60))
.RuleFor(c => c.Titre, _ => titre)
.RuleFor(c => c.IdTitre, _ => titre.IdTitre);
return faker.Generate(count);
}
}
}