-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,47 @@ | ||
using Domain.Models.Admin; | ||
using Domain.Models.Articulo; | ||
using Domain.Models.Ventas; | ||
|
||
namespace UnitTests | ||
{ | ||
public class UnitTest1 | ||
{ | ||
[Fact] | ||
public void Test1() | ||
public void TipoDeComprobanteFacturaBConEmisorRIYReceptorCF() | ||
{ | ||
string nombreComprobante = "Factura B"; | ||
|
||
CondicionTributaria condicionTributariaEmisor = new CondicionTributaria { IdCondicionTributaria = IdCondicionTributaria.ResponsableInscripto }; | ||
CondicionTributaria condicionTributariaReceptor = new CondicionTributaria { IdCondicionTributaria = IdCondicionTributaria.ConsumidorFinal }; | ||
|
||
TipoDeComprobante tipoComp = new TipoDeComprobante(condicionTributariaEmisor, condicionTributariaReceptor); | ||
|
||
Assert.Equal(nombreComprobante, tipoComp.Nombre); | ||
} | ||
|
||
[Fact] | ||
public void CalcularSubtotalMedianteLineaDeVenta() | ||
{ | ||
int cantidadComprar = 1; | ||
|
||
Articulo articulo = new Articulo | ||
{ | ||
Costo = 120_000, | ||
PorcentajeIVA = 21, | ||
MargenGanancia = 50 | ||
}; | ||
|
||
Inventario inventario = new Inventario | ||
{ | ||
Articulo = articulo, | ||
Cantidad = 10, | ||
}; | ||
|
||
LineaDeVenta ldv = new LineaDeVenta(cantidadComprar, inventario); | ||
|
||
decimal subtotal = ldv.CalcularSubtotal(); | ||
|
||
Assert.Equal(217_800, subtotal); | ||
} | ||
} | ||
} |