Skip to content

Commit

Permalink
Ajuste nas exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
fosouzadev committed Sep 21, 2024
1 parent 74b7331 commit 1717b54
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/FoSouzaDev.Common.Domain/Exceptions/ConflictException.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace FoSouzaDev.Common.Domain.Exceptions;

public sealed class ConflictException(string identifier) : Exception(message: "Already registered.")
public sealed class ConflictException(Guid id) : Exception(message: "Already registered.")
{
public string Identifier => identifier;
public Guid Id => id;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<IsPackable>true</IsPackable>
<PackageId>$(AssemblyName)</PackageId>
<Version>1.2.0</Version>
<Version>1.2.1</Version>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Authors>Felipe Souza</Authors>
<RepositoryUrl>https://github.com/fosouzadev/common-domain</RepositoryUrl>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using AutoFixture;
using FluentAssertions;
using FluentAssertions;
using FoSouzaDev.Common.Domain.Exceptions;

namespace FoSouzaDev.Common.Domain.UnitaryTests.Exceptions;
Expand All @@ -10,13 +9,13 @@ public sealed class ConflictExceptionTest : BaseTest
public void Constructor_Success_CreateAnException()
{
// Arrange
string expectedIdentifier = base.Fixture.Create<string>();
Guid expectedId = Guid.NewGuid();

// Act
ConflictException ex = new(expectedIdentifier);
ConflictException ex = new(expectedId);

// Assert
ex.Message.Should().Be("Already registered.");
ex.Identifier.Should().Be(expectedIdentifier);
ex.Id.Should().Be(expectedId);
}
}

0 comments on commit 1717b54

Please sign in to comment.