EntityTests StartAndStopBehavior Method Delta Engine Documentation

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

public void StartAndStopBehavior()
Examples

[Test]
public void StartAndStopBehavior()
{
    entityWithTags.Start<MockUpdateBehavior>();
    Assert.IsTrue(entityWithTags.ContainsBehavior<MockUpdateBehavior>());
    Assert.AreEqual(1, entities.GetEntitiesOfType<MockEntity>().Count);
    entityWithTags.Stop<MockUpdateBehavior>();
    Assert.IsFalse(entityWithTags.ContainsBehavior<MockUpdateBehavior>());
    Assert.AreEqual(1, entities.GetEntitiesOfType<MockEntity>().Count);
    entityWithTags.Stop<MockUpdateBehavior>();
}
[Test]
public void StartAndStopBehaviorDuringUpdate()
{
    entityWithTags.Start<CreateEntityStartAndStopBehavior>();
    entities.RunEntities();
    Assert.IsFalse(entityWithTags.Get<Entity>().ContainsBehavior<MockUpdateBehavior>());
}
See Also