コード例 #1
0
 public static GuideV1 CreateGuide()
 {
     return(new GuideV1
     {
         Id = IdGenerator.NextLong(),
         Name = RandomText.Name(),
         Type = RandomGuideType(),
         App = RandomText.Phrase(1, 50),
         MinVer = RandomLong.NextLong(int.MaxValue),
         MaxVer = RandomLong.NextLong(int.MaxValue),
         Tags = new List <string>
         {
             RandomText.Stuff(), IdGenerator.NextLong(), RandomText.Color(), RandomText.Name(), RandomText.Phone(), RandomText.Adjective(), "tag1"
         },
         AllTags = new List <string>
         {
             RandomText.Stuff(), RandomText.Color(), RandomText.Name(), RandomText.Phone(), RandomText.Adjective()
         },
         Status = RandomText.Verb(),
         CreateTime = DateTime.UtcNow,
         Pages = new List <GuidePageV1>
         {
             new GuidePageV1
             {
                 Title = new Dictionary <string, string>
                 {
                     { IdGenerator.NextShort(), RandomText.Word() }, { IdGenerator.NextShort(), RandomText.Word() }
                 },
                 Content = new Dictionary <string, string>
                 {
                     { IdGenerator.NextShort(), RandomText.Word() }, { IdGenerator.NextShort(), RandomText.Word() }
                 },
                 Color = RandomText.Color(),
                 PicId = IdGenerator.NextShort(),
                 PicUri = IdGenerator.NextLong()
             },
             new GuidePageV1
             {
                 Title = new Dictionary <string, string>
                 {
                     { IdGenerator.NextShort(), RandomText.Word() }, { IdGenerator.NextShort(), RandomText.Word() }
                 },
                 Content = new Dictionary <string, string>
                 {
                     { IdGenerator.NextShort(), RandomText.Word() }, { IdGenerator.NextShort(), RandomText.Word() }
                 },
                 Color = RandomText.Color(),
                 PicId = IdGenerator.NextShort(),
                 PicUri = IdGenerator.NextLong()
             }
         }
     });
 }