ADM-009: Tablas Fiscales (IVA + IIBB) — append-only versioned ref data #22
@@ -0,0 +1,99 @@
|
|||||||
|
using FluentAssertions;
|
||||||
|
using SIGCM2.Domain.Exceptions;
|
||||||
|
using SIGCM2.Domain.Fiscal;
|
||||||
|
|
||||||
|
namespace SIGCM2.Application.Tests.Domain.Fiscal;
|
||||||
|
|
||||||
|
public class FiscalExceptionsTests
|
||||||
|
{
|
||||||
|
// ── T200.30: cada excepción instancia correctamente con mensaje ───────────
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void PorcentajeInmutableException_HasExpectedMessage()
|
||||||
|
{
|
||||||
|
var ex = new PorcentajeInmutableException();
|
||||||
|
|
||||||
|
ex.Message.Should().Contain("inmutable");
|
||||||
|
ex.Message.Should().Contain("nueva versión");
|
||||||
|
ex.Message.Should().Contain("/iva/");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void AlicuotaInmutableException_HasExpectedMessage()
|
||||||
|
{
|
||||||
|
var ex = new AlicuotaInmutableException();
|
||||||
|
|
||||||
|
ex.Message.Should().Contain("inmutable");
|
||||||
|
ex.Message.Should().Contain("nueva versión");
|
||||||
|
ex.Message.Should().Contain("/iibb/");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void PredecesorYaCerradoException_ContainsId()
|
||||||
|
{
|
||||||
|
var ex = new PredecesorYaCerradoException(42);
|
||||||
|
|
||||||
|
ex.PredecesorId.Should().Be(42);
|
||||||
|
ex.Message.Should().Contain("42");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void DuplicateCodigoException_ContainsCodigo()
|
||||||
|
{
|
||||||
|
var ex = new DuplicateCodigoException("IVA_21");
|
||||||
|
|
||||||
|
ex.Codigo.Should().Be("IVA_21");
|
||||||
|
ex.Message.Should().Contain("IVA_21");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void DuplicateProvinciaException_ContainsProvincia()
|
||||||
|
{
|
||||||
|
var ex = new DuplicateProvinciaException(ProvinciaArgentina.Cordoba);
|
||||||
|
|
||||||
|
ex.Provincia.Should().Be(ProvinciaArgentina.Cordoba);
|
||||||
|
ex.Message.Should().Contain("Cordoba");
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── Todas heredan de DomainException ─────────────────────────────────────
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void PorcentajeInmutableException_InheritsFromDomainException()
|
||||||
|
{
|
||||||
|
var ex = new PorcentajeInmutableException();
|
||||||
|
|
||||||
|
ex.Should().BeAssignableTo<DomainException>();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void AlicuotaInmutableException_InheritsFromDomainException()
|
||||||
|
{
|
||||||
|
var ex = new AlicuotaInmutableException();
|
||||||
|
|
||||||
|
ex.Should().BeAssignableTo<DomainException>();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void PredecesorYaCerradoException_InheritsFromDomainException()
|
||||||
|
{
|
||||||
|
var ex = new PredecesorYaCerradoException(1);
|
||||||
|
|
||||||
|
ex.Should().BeAssignableTo<DomainException>();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void DuplicateCodigoException_InheritsFromDomainException()
|
||||||
|
{
|
||||||
|
var ex = new DuplicateCodigoException("X");
|
||||||
|
|
||||||
|
ex.Should().BeAssignableTo<DomainException>();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void DuplicateProvinciaException_InheritsFromDomainException()
|
||||||
|
{
|
||||||
|
var ex = new DuplicateProvinciaException(ProvinciaArgentina.Salta);
|
||||||
|
|
||||||
|
ex.Should().BeAssignableTo<DomainException>();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user