ComponentTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Tests.Entities ComponentTests

Namespace: DeltaEngine.Tests.Entities
Assembly: DeltaEngine.Tests (in DeltaEngine.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public class ComponentTests

The ComponentTests type exposes the following members.

Constructors

  NameDescription
Public methodComponentTests
Initializes a new instance of the ComponentTests class
Top
Methods

  NameDescription
Public methodCanCheckEntityHandlersPriority
Public methodCannontCreateEntityWithoutRunner
Public methodCreateEntityWithRotationComponent
Top
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