add AABB test

generics
Evan Hemsley 2020-01-01 23:57:47 -08:00
parent bf7a97af20
commit 9cbb1fdf31
1 changed files with 28 additions and 0 deletions

28
Test/AABBTest.cs Normal file
View File

@ -0,0 +1,28 @@
using NUnit.Framework;
using FluentAssertions;
using MoonTools.Core.Bonk;
using System.Numerics;
namespace Tests
{
public class AABBTest
{
[Test]
public void Overlapping()
{
var a = new AABB(new Vector2(-1, -1), new Vector2(1, 1));
var b = new AABB(new Vector2(0, 0), new Vector2(2, 2));
AABB.TestOverlap(a, b).Should().BeTrue();
}
[Test]
public void NotOverlapping()
{
var a = new AABB(new Vector2(-1, -1), new Vector2(1, 1));
var b = new AABB(new Vector2(-3, -3), new Vector2(-2, -2));
AABB.TestOverlap(a, b).Should().BeFalse();
}
}
}