-
Notifications
You must be signed in to change notification settings - Fork 5
/
UnitTest1.cs
61 lines (52 loc) · 1.33 KB
/
UnitTest1.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
namespace HW10_Test_Triangle
{
public class Tests
{
[SetUp]
public void Setup()
{
}
[Test]
public void Test1()
{
//Arrange
Point p1, p2, p3;
p1 = new Point(1, 1);
p2 = new Point(2, 7);
p3 = new Point(7, 3);
Triangle tr1 = new Triangle(p1, p2, p3);
//Act
double p = Convert.ToInt32(tr1.Perimetr());
//Assert
Assert.AreEqual(18, p);
}
[Test]
public void Test2()
{
//Arrange
Point p1, p2, p3;
p1 = new Point(1, 1);
p2 = new Point(2, 7);
p3 = new Point(7, 3);
Triangle tr1 = new Triangle(p1, p2, p3);
//Act
double s = Convert.ToInt32(tr1.Square());
//Assert
Assert.AreEqual(6, s);
}
[Test]
public void Test3()
{
//Arrange
Point p1, p2, p3;
p1 = new Point(1, 1);
p2 = new Point(2, 7);
p3 = new Point(7, 3);
Triangle tr1 = new Triangle(p1, p2, p3);
//Act
double d = Convert.ToInt32(tr1.Vertex1.Distance(tr1.Vertex2));
//Assert
Assert.AreEqual(8, d);
}
}
}