Archived
1
0
This repository has been archived on 2023-12-01. You can view files and clone it, but cannot push or open issues or pull requests.
Mindbox/MindBox.Tests/TriangleCreateTests.cs

42 lines
875 B
C#
Raw Normal View History

2023-11-13 22:40:23 +03:00
namespace MindBox.Tests;
public class TriangleCreateTests
{
[TestCase(-1.0, 1.0, 1.0)]
[TestCase(1.0, -1.0, 1.0)]
[TestCase(1.0, 1.0, -1.0)]
public void NegativeSide(double a, double b, double c)
{
Assert.Throws<ArgumentException>(() => new Triangle(a, b, c));
}
[TestCase(0.0, 1.0, 1.0)]
[TestCase(1.0, 0.0, 1.0)]
[TestCase(1.0, 1.0, 0.0)]
public void ZeroSide(double a, double b, double c)
{
Assert.Throws<ArgumentException>(() => new Triangle(a, b, c));
}
[TestCase(4, 5, 9)]
[TestCase(4, 5, 10)]
public void WrongSides(double a, double b, double c)
{
Assert.Throws<ArgumentException>(() => new Triangle(a, b, c));
}
}
public class TriangleRightTests
{
[Test]
public void IsRight()
{
Assert.IsTrue(new Triangle(3.0, 4.0, 5.0).IsRight());
}
[Test]
public void IsNotRight()
{
Assert.IsFalse(new Triangle(1.0, 1.0, 1.0).IsRight());
}
}