Inheritance Hierarchy
DeltaEngine.Tests.Entities ComponentTests
Namespace: DeltaEngine.Tests.Entities
Assembly: DeltaEngine.Tests (in DeltaEngine.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The ComponentTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
ComponentTests | Initializes a new instance of the ComponentTests class |
Methods
Name | Description | |
---|---|---|
CanCheckEntityHandlersPriority | ||
CannontCreateEntityWithoutRunner | ||
CreateEntityWithRotationComponent |
Examples
[Test] public void CannontCreateEntityWithoutRunner() { if (EntitiesRunner.Current != null) EntitiesRunner.Current.Dispose(); Assert.Throws<Entity.UnableToCreateEntityWithoutInitializedResolverAndEntitiesRunner>( () => new MockEntity()); }
[Test] public void CreateEntityWithRotationComponent() { var entities = new MockEntitiesRunner(typeof(Rotate)); var entity = new MockEntity().Add(0.5f).Start<Rotate>(); Assert.AreEqual(0.5f, entity.Get<float>()); entities.RunEntities(); Assert.AreEqual(0.55f, entity.Get<float>()); }
[Test] public void CanCheckEntityHandlersPriority() { EntitiesRunner entities = new MockEntitiesRunner(typeof(Rotate)); Assert.AreEqual(Priority.First, entities.GetUpdateBehavior<Rotate>().priority); }
See Also