Created
February 13, 2022 13:27
-
-
Save fernanduandrade/9901165cfb1bb66a1d8483cc9823d4ff to your computer and use it in GitHub Desktop.
Fixture Class
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
using Areas.Entity; | |
using Xunit; | |
namespace AreasTest | |
{ | |
public class AreaFixture | |
{ | |
public Area Area => new(); | |
} | |
public class AreasTest : IClassFixture<AreaFixture> | |
{ | |
private readonly AreaFixture _areaFixture; | |
public AreasTest(AreaFixture areaFixture) | |
{ | |
_areaFixture = areaFixture; | |
} | |
[Fact] | |
public void TesteAreaDoQuadrado() | |
{ | |
Area area = _areaFixture.Area; | |
int result = area.Quadrado(5); | |
Assert.Equal(25, result); | |
} | |
[Fact] | |
public void TesteAreaDoTriangulo() | |
{ | |
Area area = _areaFixture.Area; | |
int result = area.Triangulo(10, 5); | |
Assert.Equal(25, result); | |
} | |
[Fact] | |
public void TesteAreaDoRetangulo() | |
{ | |
Area area = _areaFixture.Area; | |
int result = area.Retangulo(5, 3); | |
Assert.Equal(15, result); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment