-
Notifications
You must be signed in to change notification settings - Fork 299
/
Copy pathRectangleIntersection_Tests.cs
45 lines (40 loc) · 1.35 KB
/
RectangleIntersection_Tests.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
using Advanced.Algorithms.Geometry;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Advanced.Algorithms.Tests.Geometry
{
[TestClass]
public class RectangleIntersectionTests
{
[TestMethod]
public void RectIntersection_Smoke_Test()
{
var rectangleComparer = new RectangleComparer();
var result = RectangleIntersection.FindIntersection(new Rectangle
{
LeftTop = new Point(0, 10),
RightBottom = new Point(10, 0)
},
new Rectangle
{
LeftTop = new Point(5, 5),
RightBottom = new Point(15, 0)
});
Assert.IsTrue(rectangleComparer.Equals(result, new Rectangle
{
LeftTop = new Point(5, 5),
RightBottom = new Point(10, 0)
}));
result = RectangleIntersection.FindIntersection(new Rectangle
{
LeftTop = new Point(0, 10),
RightBottom = new Point(4, 0)
},
new Rectangle
{
LeftTop = new Point(5, 5),
RightBottom = new Point(15, 0)
});
Assert.IsTrue(rectangleComparer.Equals(result, null));
}
}
}