public void CreateAsyncTest() { var repository = CommentRepository.Create(); var comment = this.CreateComment(repository, SeedComment.Create()); var service = this.GetCommentService(repository); service.CreateAsync(new CreateCommentInputModel { Content = "New comment" }).GetAwaiter(); Assert.Equal(2, repository.All().Count()); }
public void GetLatesByCreatedOnTest() { var repository = CommentRepository.Create(); var comment = this.CreateComment(repository, SeedComment.Create()); var secondComment = this.CreateComment(repository, SeedComment.CreateSecond()); var thirdComment = this.CreateComment(repository, SeedComment.CreateThird()); var service = this.GetCommentService(repository); var result = service.GetLatesByCreatedOn <CommentDummyModel>(1); Assert.Empty(result); }