Skip to content
Snippets Groups Projects

Add tests

Merged Soňa Nemečkayová requested to merge review-tests into restaurant-location-user-testing
3 files
+ 58
0
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -97,6 +97,19 @@ namespace BusinessLayer.Tests.Services
Assert.False(result);
}
[Fact]
public async Task DeleteReviewByIdAsync_DeletedReview_ReturnsFalse()
{
// Arrange
var reviewId = FakeSeedingValues.DeletedReviewId;
// Act
var result = await _service.DeleteReviewByIdAsync(reviewId);
// Assert
Assert.False(result);
}
[Fact]
public async Task GetReviewAsync_ReviewExists_Succeeds()
{
@@ -129,6 +142,19 @@ namespace BusinessLayer.Tests.Services
Assert.All(result, r => Assert.Equal(FakeSeedingValues.Restaurant1Id, r.RestaurantId));
}
[Fact]
public async Task GetReviewAsync_DeletedReview_ReturnsNull()
{
// Arrange
var reviewId = FakeSeedingValues.DeletedReviewId;
// Act
var result = await _service.GetReviewAsync(reviewId);
// Assert
Assert.Null(result);
}
[Fact]
public async Task UpdateReviewAsync_ReviewExists_Succeeds()
{
@@ -165,5 +191,23 @@ namespace BusinessLayer.Tests.Services
// Assert
Assert.Null(result);
}
[Fact]
public async Task UpdateReviewAsync_DeletedReview_ReturnsNull()
{
// Arrange
var reviewId = FakeSeedingValues.DeletedReviewId;
var updateData = new ReviewUpdateDTO
{
Content = "Updated content for a deleted review"
};
// Act
var result = await _service.UpdateReviewAsync(reviewId, updateData);
// Assert
Assert.Null(result);
}
}
}
Loading