test undeclared some

pull/5/head
Evan Hemsley 2019-06-16 18:16:45 -07:00
parent 0e3c775bc5
commit e8a8488dbb
1 changed files with 20 additions and 0 deletions

View File

@ -274,5 +274,25 @@ namespace Tests
Assert.That(someTest, Is.True);
}
class UndeclaredSomeEngine : Engine
{
public override void Update(float dt)
{
someTest = this.Some<MockMessage>();
}
}
[Test]
public void IllegalSome()
{
var worldBuilder = new WorldBuilder();
worldBuilder.AddEngine<EmitMockMessageEngine>();
worldBuilder.AddEngine<UndeclaredSomeEngine>();
var world = worldBuilder.Build();
Assert.Throws<IllegalMessageReadException>(() => world.Update(0.01f));
}
}
}