-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
07bc57d
commit d75151d
Showing
3 changed files
with
22 additions
and
53 deletions.
There are no files selected for viewing
37 changes: 0 additions & 37 deletions
37
MediatR.AspNet/MediatR.AspNet.Tests/ApplicationExceptionMiddlewareTests.cs
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
MediatR.AspNet/MediatR.AspNet.Tests/ExceptionsTests/BaseApplicationExceptionTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using FluentAssertions; | ||
using Microsoft.AspNetCore.Http; | ||
using NSubstitute; | ||
using NUnit.Framework; | ||
|
||
namespace MediatR.AspNet.Tests.ExceptionsTests; | ||
|
||
public class BaseApplicationExceptionTests { | ||
[Test] | ||
public void ToProblemDetails_ShouldReturnProblemDetails() { | ||
// Arrange | ||
var exception = Substitute.For<BaseApplicationException>("Test code", StatusCodes.Status403Forbidden, "Test message"); | ||
|
||
// Act | ||
var problemDetails = exception.ToProblemDetails(); | ||
|
||
// Assert | ||
problemDetails.Message.Should().Be(exception.Message); | ||
problemDetails.Code.Should().Be(exception.Code); | ||
problemDetails.Status.Should().Be(exception.Status); | ||
} | ||
} |
16 changes: 0 additions & 16 deletions
16
MediatR.AspNet/MediatR.AspNet.Tests/Factories/ActionContextFactory.cs
This file was deleted.
Oops, something went wrong.