test(adm-009): TipoDeIva + IngresosBrutos handler tests (Red)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
using System.Reflection;
|
||||
using FluentAssertions;
|
||||
using SIGCM2.Domain.Entities;
|
||||
using SIGCM2.Domain.Fiscal;
|
||||
using IibbDomain = SIGCM2.Domain.Entities.IngresosBrutos;
|
||||
|
||||
namespace SIGCM2.Application.Tests.Domain.Fiscal;
|
||||
|
||||
@@ -10,7 +10,7 @@ public class IngresosBrutosTests
|
||||
private static readonly DateOnly Desde2020 = new(2020, 1, 1);
|
||||
private static readonly DateOnly Desde2026 = new(2026, 6, 1);
|
||||
|
||||
private static IngresosBrutos MakeIIBB(
|
||||
private static IibbDomain MakeIIBB(
|
||||
int id = 1,
|
||||
ProvinciaArgentina provincia = ProvinciaArgentina.BuenosAires,
|
||||
string descripcion = "IIBB Buenos Aires",
|
||||
@@ -19,7 +19,7 @@ public class IngresosBrutosTests
|
||||
DateOnly? vigenciaDesde = null,
|
||||
DateOnly? vigenciaHasta = null,
|
||||
int? predecesorId = null)
|
||||
=> IngresosBrutos.FromDb(
|
||||
=> IibbDomain.FromDb(
|
||||
id: id,
|
||||
provincia: provincia,
|
||||
descripcion: descripcion,
|
||||
@@ -36,7 +36,7 @@ public class IngresosBrutosTests
|
||||
[Fact]
|
||||
public void ForCreation_ValidArgs_ReturnsEntity()
|
||||
{
|
||||
var iibb = IngresosBrutos.ForCreation(ProvinciaArgentina.Cordoba, "IIBB Córdoba", 2.5m, Desde2020);
|
||||
var iibb = IibbDomain.ForCreation(ProvinciaArgentina.Cordoba, "IIBB Córdoba", 2.5m, Desde2020);
|
||||
|
||||
iibb.Provincia.Should().Be(ProvinciaArgentina.Cordoba);
|
||||
iibb.Descripcion.Should().Be("IIBB Córdoba");
|
||||
@@ -50,7 +50,7 @@ public class IngresosBrutosTests
|
||||
[Fact]
|
||||
public void ForCreation_AlicuotaNegativa_ThrowsArgumentException()
|
||||
{
|
||||
var act = () => IngresosBrutos.ForCreation(ProvinciaArgentina.BuenosAires, "desc", -1m, Desde2020);
|
||||
var act = () => IibbDomain.ForCreation(ProvinciaArgentina.BuenosAires, "desc", -1m, Desde2020);
|
||||
|
||||
act.Should().Throw<ArgumentException>()
|
||||
.WithParameterName("alicuota");
|
||||
@@ -59,7 +59,7 @@ public class IngresosBrutosTests
|
||||
[Fact]
|
||||
public void ForCreation_AlicuotaMayorA100_ThrowsArgumentException()
|
||||
{
|
||||
var act = () => IngresosBrutos.ForCreation(ProvinciaArgentina.BuenosAires, "desc", 101m, Desde2020);
|
||||
var act = () => IibbDomain.ForCreation(ProvinciaArgentina.BuenosAires, "desc", 101m, Desde2020);
|
||||
|
||||
act.Should().Throw<ArgumentException>()
|
||||
.WithParameterName("alicuota");
|
||||
@@ -71,7 +71,7 @@ public class IngresosBrutosTests
|
||||
[InlineData(100)]
|
||||
public void ForCreation_AlicuotaEnRango_NoLanza(double alicuota)
|
||||
{
|
||||
var act = () => IngresosBrutos.ForCreation(ProvinciaArgentina.Salta, "desc", (decimal)alicuota, Desde2020);
|
||||
var act = () => IibbDomain.ForCreation(ProvinciaArgentina.Salta, "desc", (decimal)alicuota, Desde2020);
|
||||
|
||||
act.Should().NotThrow();
|
||||
}
|
||||
@@ -82,7 +82,7 @@ public class IngresosBrutosTests
|
||||
var desde = new DateOnly(2026, 6, 1);
|
||||
var hasta = new DateOnly(2026, 1, 1);
|
||||
|
||||
var act = () => IngresosBrutos.ForCreation(ProvinciaArgentina.SantaFe, "desc", 3m, desde, hasta);
|
||||
var act = () => IibbDomain.ForCreation(ProvinciaArgentina.SantaFe, "desc", 3m, desde, hasta);
|
||||
|
||||
act.Should().Throw<ArgumentException>()
|
||||
.WithParameterName("vigenciaHasta");
|
||||
@@ -209,7 +209,7 @@ public class IngresosBrutosTests
|
||||
[Fact]
|
||||
public void IngresosBrutos_No_Debe_Exponer_WithAlicuota()
|
||||
{
|
||||
var method = typeof(IngresosBrutos).GetMethod("WithAlicuota", BindingFlags.Public | BindingFlags.Instance);
|
||||
var method = typeof(IibbDomain).GetMethod("WithAlicuota", BindingFlags.Public | BindingFlags.Instance);
|
||||
|
||||
method.Should().BeNull("Alicuota es inmutable — usar NuevaVersion");
|
||||
}
|
||||
@@ -217,7 +217,7 @@ public class IngresosBrutosTests
|
||||
[Fact]
|
||||
public void IngresosBrutos_No_Debe_Exponer_WithProvincia()
|
||||
{
|
||||
var method = typeof(IngresosBrutos).GetMethod("WithProvincia", BindingFlags.Public | BindingFlags.Instance);
|
||||
var method = typeof(IibbDomain).GetMethod("WithProvincia", BindingFlags.Public | BindingFlags.Instance);
|
||||
|
||||
method.Should().BeNull("Provincia es inmutable en IngresosBrutos");
|
||||
}
|
||||
@@ -228,7 +228,7 @@ public class IngresosBrutosTests
|
||||
public void FromDb_SetsAllProperties()
|
||||
{
|
||||
var fechaCreacion = DateTime.UtcNow;
|
||||
var iibb = IngresosBrutos.FromDb(
|
||||
var iibb = IibbDomain.FromDb(
|
||||
id: 10, provincia: ProvinciaArgentina.Tucuman, descripcion: "IIBB Tucuman",
|
||||
alicuota: 1.5m, activo: true,
|
||||
vigenciaDesde: Desde2020, vigenciaHasta: null,
|
||||
|
||||
Reference in New Issue
Block a user