2019-07-19 00:50:38 +00:00
|
|
|
using NUnit.Framework;
|
|
|
|
using FluentAssertions;
|
|
|
|
|
|
|
|
using Encompass;
|
2019-12-20 20:52:38 +00:00
|
|
|
using Encompass.Exceptions;
|
2019-07-19 00:50:38 +00:00
|
|
|
|
|
|
|
namespace Tests
|
|
|
|
{
|
|
|
|
public class EntityTests
|
|
|
|
{
|
|
|
|
[Test]
|
|
|
|
public void Equals()
|
|
|
|
{
|
|
|
|
var worldBuilder = new WorldBuilder();
|
|
|
|
var entity = worldBuilder.CreateEntity();
|
|
|
|
var entityTwo = worldBuilder.CreateEntity();
|
|
|
|
|
|
|
|
var copyEntity = entity;
|
|
|
|
|
|
|
|
Assert.AreNotEqual(entity, entityTwo);
|
|
|
|
Assert.AreEqual(entity, entity);
|
|
|
|
Assert.IsTrue(entity == copyEntity);
|
|
|
|
}
|
2019-12-20 20:52:38 +00:00
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void EntityOverflowException()
|
|
|
|
{
|
|
|
|
var worldBuilder = new WorldBuilder(16);
|
|
|
|
|
|
|
|
for (var i = 0; i < 16; i++)
|
|
|
|
{
|
|
|
|
worldBuilder.CreateEntity();
|
|
|
|
}
|
|
|
|
|
|
|
|
Assert.Throws<EntityOverflowException>(() => worldBuilder.CreateEntity());
|
|
|
|
}
|
2019-07-19 00:50:38 +00:00
|
|
|
}
|
2019-12-20 20:52:38 +00:00
|
|
|
}
|