Exemplo n.º 1
0
Arquivo: Book.cs Projeto: snluu/nkv
        public static Book Generate()
        {
            var lipsumGenerator = new LipsumGenerator();

            return(new Book
            {
                Key = Guid.NewGuid().ToString(),
                Title = lipsumGenerator.GenerateSentences(1, Sentence.Short)[0],
                Abstract = lipsumGenerator.GenerateParagraphs(1, Paragraph.Medium)[0],
                Authors = new string[] { NameFaker.Name(), NameFaker.Name() },
                Price = 9999m * (decimal)_rand.NextDouble() + 0.99m,
                ReleaseDate = DateTimeFaker.BirthDay(),
                Pages = _rand.Next(5, 3000),
                Category = EnumFaker.SelectFrom <BookCategory>()
            });
        }
Exemplo n.º 2
0
 public void EnumFakerTest()
 {
     DisplayAndExecute(new Expression <Func <TestEnum> >[] {
         () => EnumFaker.SelectFrom <TestEnum>()
     });
 }