Protogame.Tests.ComponentTests.TestRequireComponentResolutionInReverse C# (CSharp) Méthode

TestRequireComponentResolutionInReverse() public méthode

public TestRequireComponentResolutionInReverse ( ) : void
Résultat void
        public void TestRequireComponentResolutionInReverse()
        {
            var kernel = new StandardKernel();
            kernel.Load<ProtogameComponentModule>();

            var factory = kernel.Get<IEntityFactory>();
            factory.HierarchyRoot = new object();
            factory.PlanForEntityCreation<EntityD>(); // These are swapped around
            factory.PlanForEntityCreation<EntityA>();
            var entities = factory.CreateEntities();

            var entityA = entities.OfType<EntityA>().First();
            var entityD = entities.OfType<EntityD>().First();

            _assert.Same(entityA.ComponentA, entityD.ComponentA);
        }