Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions CR.Exceptions.AspNet.UnitTests/ExceptionMappingOptionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@ namespace CR.Exceptions.AspNet.UnitTests;

public sealed class ExceptionMappingOptionsTests
{
[Theory]
[InlineData(typeof(TestNotFoundException), StatusCodes.Status404NotFound)]
[InlineData(typeof(TestConflictException), StatusCodes.Status409Conflict)]
public void Should_Return_Correct_Status_Code(Type exceptionType, int expectedStatusCode)
[Fact]
public void Should_Return_404_Status_Code_For_NotFoundException()
{
var options = new ExceptionMappingOptions().AddDefaultMappings();
var exception = (CrException)Activator.CreateInstance(exceptionType)!;
var exception = new TestNotFoundException();

var statusCode = options.FindHttpStatusCode(exception);

statusCode.Should()
.Be(expectedStatusCode);
.Be(StatusCodes.Status404NotFound);
}
}
8 changes: 0 additions & 8 deletions CR.Exceptions.AspNet.UnitTests/TestConflictException.cs

This file was deleted.

5 changes: 3 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Company>AptdCR</Company>
<Company>apptade</Company>
<Authors>apptade</Authors>

<PublishRepositoryUrl>true</PublishRepositoryUrl>
Expand All @@ -11,9 +11,10 @@
<NoWarn>$(NoWarn);1591</NoWarn>

<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
</PropertyGroup>

<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)README.md" Pack="true" PackagePath="\" />
<None Include="$(MSBuildThisFileDirectory)README.md" Pack="true" PackagePath="\" Visible="false" />
</ItemGroup>
</Project>
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

A lightweight library for defining application exceptions and automatically converting them into HTTP responses in ASP.NET Core.

## Packages

- **CR.Exceptions** — Base exception types and error models.
- **CR.Exceptions.AspNet** — ASP.NET Core exception handler integration.

## Installation

Register the exception handler during application startup.
Expand Down
Loading