Beispiel #1
0
 public List <Suggestion> Suggestions(int howMany)
 {
     return(_fakeSuggestionsService.Generate(howMany));
 }
Beispiel #2
0
        /// <summary>
        /// Génère un certain nombre d'utilisateurs au hasard
        /// </summary>
        /// <param name="howMany"></param>
        /// <returns></returns>
        public List <User> Generate(int howMany)
        {
            var testUser = new Faker <User>().StrictMode(true)
                           .RuleFor(u => u.UserName, f => f.Name.FirstName(Bogus.DataSets.Name.Gender.Male))
                           .RuleFor(u => u.Books, f => CustomAutoMapper.MapLists <Book, User.Book>(_fakeBooksService.Generate(6)))
                           .RuleFor(u => u.Suggestions, f => CustomAutoMapper.MapLists <Suggestion, User.Suggestion>(_fakeSuggestionsService.Generate(6)))
                           .RuleFor(u => u.FavoriteCategories, f => BooksSamples.GetCategories(3));

            return(testUser.Generate(howMany));
        }