EntityTests DeactivateAndActivateEntity 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 DeactivateAndActivateEntity()
Examples

[Test]
public void DeactivateAndActivateEntity()
{
    entityWithTags.Start<MockUpdateBehavior>();
    entityWithTags.IsActive = false;
    Assert.IsFalse(entityWithTags.IsActive);
    Assert.AreEqual(0, entities.GetEntitiesOfType<MockEntity>().Count);
    entityWithTags.IsActive = true;
    Assert.IsTrue(entityWithTags.IsActive);
    Assert.IsTrue(entityWithTags.ContainsBehavior<MockUpdateBehavior>());
    Assert.AreEqual(1, entities.GetEntitiesOfType<MockEntity>().Count);
}
See Also