public async Task TotalCommentAsync_ShouldSeeDeletedCommentsTrue_ShouldReturnAllComments() { // Arrange FitStoreDbContext database = this.Database; DatabaseHelper.SeedData(database); ISupplementService supplementService = new SupplementService(database); // Act int result = await supplementService.TotalCommentsAsync(firstSupplementId, true); // Assert result.Should().Be(2); }
public async Task TotalCommentAsync_ShouldSeeDeletedCommentsTrue_ShouldReturnAllFalseComments() { // Arrange FitStoreDbContext database = this.Database; DatabaseHelper.SeedData(database); database.Comments.Where(c => c.SupplementId == firstSupplementId).FirstOrDefault().IsDeleted = true; database.SaveChanges(); ISupplementService supplementService = new SupplementService(database); // Act int result = await supplementService.TotalCommentsAsync(firstSupplementId, false); // Assert result.Should().Be(1); }