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); }
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); }
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); }
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()); }