Skip to content

Commit

Permalink
ToProblemdetailsTests
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Feb 23, 2024
1 parent 07bc57d commit d75151d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 53 deletions.

This file was deleted.

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

This file was deleted.

0 comments on commit d75151d

Please sign in to comment.