mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-21 01:39:32 +00:00
Add test coverage
This commit is contained in:
@@ -4,6 +4,8 @@ using Xunit;
|
|||||||
|
|
||||||
namespace MonoGame.Extended.Collisions.Tests
|
namespace MonoGame.Extended.Collisions.Tests
|
||||||
{
|
{
|
||||||
|
using MonoGame.Extended.Collisions.Layers;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Test collision of actors with various shapes.
|
/// Test collision of actors with various shapes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -376,6 +378,16 @@ namespace MonoGame.Extended.Collisions.Tests
|
|||||||
Assert.True(dynamicActor.IsColliding);
|
Assert.True(dynamicActor.IsColliding);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void InsertActor_ThrowsUndefinedLayerException_IfThereIsNoLayerDefined()
|
||||||
|
{
|
||||||
|
var sut = new CollisionComponent();
|
||||||
|
|
||||||
|
var act = () => sut.Insert(new CollisionIndicatingActor(RectangleF.Empty));
|
||||||
|
|
||||||
|
Assert.Throws<UndefinedLayerException>(act);
|
||||||
|
}
|
||||||
|
|
||||||
private class CollisionIndicatingActor : ICollisionActor
|
private class CollisionIndicatingActor : ICollisionActor
|
||||||
{
|
{
|
||||||
private RectangleF _bounds;
|
private RectangleF _bounds;
|
||||||
|
|||||||
Reference in New Issue
Block a user