Example #1
0
        public void SystemOrdering(ISystem system0, ISystem system1, ISystem system2, ISystem system3)
        {
            List <SystemExecutionGroup> groups = SystemExecutionGroup.GetExecutionGroups(new List <ISystem>()
            {
                system0, system1, system2, system3
            });

            Assert.Equal(2, groups.Count);

            SystemExecutionGroup singleGroup;
            SystemExecutionGroup bigGroup;

            if (groups[0].Systems.Count == 1)
            {
                singleGroup = groups[0];
                bigGroup    = groups[1];
            }
            else
            {
                singleGroup = groups[1];
                bigGroup    = groups[0];
            }

            Assert.Equal(1, singleGroup.Systems.Count);
            Assert.IsType <SystemConcurrent>(singleGroup.Systems[0]);

            Assert.Equal(3, bigGroup.Systems.Count);
            Assert.IsType <SystemBeforeA>(bigGroup.Systems[0]);
            Assert.IsType <SystemA>(bigGroup.Systems[1]);
            Assert.IsType <SystemAfterA>(bigGroup.Systems[2]);
        }
Example #2
0
        public void AllConcurrentSystems(ISystem systemA, ISystem systemB, ISystem systemC)
        {
            List <SystemExecutionGroup> groups = SystemExecutionGroup.GetExecutionGroups(new List <ISystem>()
            {
                systemA, systemB, systemC
            });

            Assert.Equal(3, groups.Count);
            Assert.Equal(1, groups[0].Systems.Count);
            Assert.Equal(1, groups[1].Systems.Count);
            Assert.Equal(1, groups[2].Systems.Count);
        }