Skip to content
Open
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
9 changes: 9 additions & 0 deletions BusinessLogic.Test/BusinessLogic.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,13 @@
<PackageReference Include="coverlet.collector" Version="3.2.0"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\TryOut\TryOut.csproj" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BusinessLogic\BusinessLogic.csproj" />
</ItemGroup>


</Project>
12 changes: 11 additions & 1 deletion BusinessLogic.Test/UnitTest1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@ namespace BusinessLogic.Test;
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
public void TestCalculator()
{
//arrange
var calculator = new CostCalculator();
var cost = calculator.CalculateCost(10, 10, 800);

//act
var exception = Assert.ThrowsException<ArgumentException>(() => calculator.CalculateCost(10, 10, 800));

//assert
Assert.AreEqual(80000, cost);

}
}
12 changes: 12 additions & 0 deletions BusinessLogic/Baldosa.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace BusinessLogic;

public class Baldosa
{
//Atributos
public int largo { get; set; }
public int ancho { get; set; }
public int costoPorMetroCuadrado { get; set; }
public string tipoMaterial { get; set; }
public string tipoBaldosa { get; set; }
public int costoTotal { get; set; }
}
10 changes: 10 additions & 0 deletions BusinessLogic/CostCalculator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace BusinessLogic;

public class CostCalculator
{
public int CalculateCost(int largo, int ancho, int costoPorMetroCuadrado)
{
return largo * ancho * costoPorMetroCuadrado;
}

}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ Una empresa de baldosas quiere programar un sistema para calcular los costos de
## Contestar en el README

5. ¿Qué archivo se modificó para lograr el ejercicio 2?
- Para conectar el proyecto test con el proyecto backend se modificó el archivo BusinessLogic.Test.csproj agregando las referencias correspondientes para que ambos archivos queden conectados.
6. En su código, ¿Qué pasa si alguien desea agregar un nuevo tipo de figura?
7. Cuando usted compila su código, dotnet genera archivos .DLL, ¿Qué contienen esos archivos y cómo son usados por el CLR?