public static MangaEntity CreateRandomManga(Randomizer randomizer, int mangaId) { if (WordsDataSet.Length == 0) { throw new Exception("no"); } MangaEntity newManga = new MangaEntity { MangaId = mangaId, Name = randomizer.GetRandomString(WordsDataSet), PageNumbers = randomizer.GetRandomNumber(1, 10000), Colorization = randomizer.GetRandomNumber(0, 2), PublishDate = randomizer.GetRandomDateTime(new DateTime(1900, 1, 1), DateTime.Now) }; return(newManga); }
public static ViewEntity CreateRandomView(Randomizer randomizer, AutorEntity user, MangaEntity manga, ResourceEntity platform) { ViewEntity newView = new ViewEntity(); newView.MangaId = manga.MangaId; newView.ResourceId = platform.ResourceId; newView.Date = randomizer.GetRandomDateTime(user.BirthDay, DateTime.Now); newView.Mark = randomizer.GetRandomNumber(0, 100); string randomText = ""; int randomValue = randomizer.GetRandomNumber(1, 5); for (int i = 0; i != randomValue; i++) { randomText += randomizer.GetRandomString(WordsDataSet) + " "; } newView.Comment = randomText; return(newView); }