EntitiesRunner NumberOfEntities Property Delta Engine Documentation

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

public int NumberOfEntities { get; }

Property Value

Type: Int32
Remarks

Tests: DeltaEngine.Tests.Entities.EntitiesRunnerTests
Examples

6 unit tests call DeltaEngine.Entities.EntitiesRunner.NumberOfEntities
[Test]
public void EntityIsCreatedActiveAndAutomaticallyAddedToEntitySystem()
{
    var entity = new MockEntity();
    Assert.IsTrue(entity.IsActive);
    Assert.AreEqual(1, EntitiesRunner.Current.NumberOfEntities);
}
[Test]
public void InactivateEntity()
{
    var entity = new MockEntity();
    entity.IsActive = false;
    Assert.IsFalse(entity.IsActive);
    Assert.AreEqual(0, EntitiesRunner.Current.NumberOfEntities);
}
[Test]
public void ActivateEntity()
{
    var entity = new MockEntity { IsActive = false };
    entity.IsActive = true;
    Assert.AreEqual(1, EntitiesRunner.Current.NumberOfEntities);
}
See Also