Example #1
0
        private (List <Article>, List <Tag>) CreateDummyData()
        {
            List <Tag>        tagsSubset        = TagFaker.Generate(3);
            List <ArticleTag> joinsSubSet       = ArticleTagFaker.Generate(3);
            Article           articleTagsSubset = ArticleFaker.Generate();

            articleTagsSubset.ArticleTags = joinsSubSet.ToHashSet();

            for (int index = 0; index < 3; index++)
            {
                joinsSubSet[index].Article = articleTagsSubset;
                joinsSubSet[index].Tag     = tagsSubset[index];
            }

            List <Tag>        allTags      = TagFaker.Generate(3).Concat(tagsSubset).ToList();
            List <ArticleTag> completeJoin = ArticleTagFaker.Generate(6);

            Article articleWithAllTags = ArticleFaker.Generate();

            articleWithAllTags.ArticleTags = completeJoin.ToHashSet();

            for (int index = 0; index < 6; index++)
            {
                completeJoin[index].Article = articleWithAllTags;
                completeJoin[index].Tag     = allTags[index];
            }

            List <Article> articles = ArrayFactory.Create(articleTagsSubset, articleWithAllTags).ToList();

            return(articles, allTags);
        }
Example #2
0
        private (List <Article>, List <Tag>) CreateDummyData()
        {
            var tagsSubset        = TagFaker.Generate(3);
            var joinsSubSet       = ArticleTagFaker.Generate(3);
            var articleTagsSubset = ArticleFaker.Generate();

            articleTagsSubset.ArticleTags = joinsSubSet.ToHashSet();
            for (int i = 0; i < 3; i++)
            {
                joinsSubSet[i].Article = articleTagsSubset;
                joinsSubSet[i].Tag     = tagsSubset[i];
            }

            var allTags      = TagFaker.Generate(3).Concat(tagsSubset).ToList();
            var completeJoin = ArticleTagFaker.Generate(6);

            var articleWithAllTags = ArticleFaker.Generate();

            articleWithAllTags.ArticleTags = completeJoin.ToHashSet();

            for (int i = 0; i < 6; i++)
            {
                completeJoin[i].Article = articleWithAllTags;
                completeJoin[i].Tag     = allTags[i];
            }

            var articles = ArrayFactory.Create(articleTagsSubset, articleWithAllTags).ToList();

            return(articles, allTags);
        }