first unit test

This commit is contained in:
2019-10-25 03:16:17 -06:00
parent 6901925c69
commit 93b22ef2ec
21 changed files with 275 additions and 254 deletions

View File

@@ -0,0 +1,34 @@
using NUnit.Framework;
using Moq;
using Shapes;
namespace Tests
{
public class RectangleTests
{
private Mock<Point> point1;
[SetUp]
public void Setup()
{
point1 = new Mock<Point>();
}
[Test]
public void RectangleWithPoints()
{
var rectangle = new Rectangle(
new Point(20,20),
new Point(30,20),
new Point(30,30),
new Point(20,30));
Assert.IsTrue(rectangle.GetType() == typeof(Rectangle));
Assert.IsTrue(rectangle.Height == 10 && rectangle.Width == 10 );
Assert.IsTrue(rectangle.Lines.Count == 4);
foreach (var line in rectangle.Lines)
{
Assert.IsTrue(line.ComputeLength() == 10);
}
}
}
}