Ejemplo n.º 1
0
        public void GetLastByCreatedOnTest()
        {
            var repository    = ArticleRepository.Create();
            var article       = this.CreateArticle(repository, SeedArticle.Create());
            var secondArticle = this.CreateArticle(repository, SeedArticle.CreateSecondArticle());
            var thirdArticle  = this.CreateArticle(repository, SeedArticle.CreateThirdArticle());
            var service       = this.GetArticlesService(repository);
            var result        = service.GetLastByCreatedOn <ArticleDumyModel>().GetAwaiter().GetResult();

            Assert.Equal(thirdArticle.Id, result.Id);
        }
Ejemplo n.º 2
0
        public void GetLatesLocalArticlesOneMatchTest()
        {
            var repository    = ArticleRepository.Create();
            var article       = this.CreateArticle(repository, SeedArticle.Create());
            var secondArticle = this.CreateArticle(repository, SeedArticle.CreateSecondArticle());
            var thirdArticle  = this.CreateArticle(repository, SeedArticle.CreateThirdArticle());
            var service       = this.GetArticlesService(repository);
            var result        = service.GetLatesLocalArticles <ArticleDumyModel>();

            Assert.Single(result);
        }
Ejemplo n.º 3
0
        public void GetLatesMostCommentedTest()
        {
            var repository    = ArticleRepository.Create();
            var article       = this.CreateArticle(repository, SeedArticle.Create());
            var secondArticle = this.CreateArticle(repository, SeedArticle.CreateSecondArticle());
            var thirdArticle  = this.CreateArticle(repository, SeedArticle.CreateThirdArticle());
            var service       = this.GetArticlesService(repository);
            var result        = service.GetLatesMostCommented <ArticleDumyModel>();

            Assert.Empty(result);
        }
Ejemplo n.º 4
0
        public void GetLatesInternationalArticlesTwoMatchesTest()
        {
            var repository    = ArticleRepository.Create();
            var article       = this.CreateArticle(repository, SeedArticle.Create());
            var secondArticle = this.CreateArticle(repository, SeedArticle.CreateSecondArticle());
            var thirdArticle  = this.CreateArticle(repository, SeedArticle.CreateThirdArticle());
            var service       = this.GetArticlesService(repository);
            var result        = service.GetLatesInternationalArticles <ArticleDumyModel>();

            Assert.Equal(2, result.Count());
        }