Ejemplo n.º 1
0
        public void OnlySchedulableActionsAreStarted()
        {
            //arrange
            var orchestrators = new[]
            {
                Get.MotherFor.MockAnarchyActionOrchestrator.OrchestratorWithSchedule.Build(),
                Get.MotherFor.MockAnarchyActionOrchestrator.OrchestratorWithUnschedulableAction.Build(),
                Get.MotherFor.MockAnarchyActionOrchestrator.OrchestratorWithSchedule.Build(),
            };

            var sut = new AnarchyManagerNew(orchestrators);

            //act
            sut.StartAllSchedules();

            //assert
            foreach (var orchestrator in orchestrators)
            {
                if (orchestrator.AnarchyAction is ICauseScheduledAnarchy)
                {
                    orchestrator.Received(1).Start();
                }
                else
                {
                    orchestrator.DidNotReceive().Start();
                }
            }
        }
Ejemplo n.º 2
0
        public void NoOrchestrators()
        {
            //arrange
            var sut = new AnarchyManagerNew(new IActionOrchestrator[] {  });

            //act/assert
            Assert.DoesNotThrow(() => sut.StartAllSchedules());
        }
Ejemplo n.º 3
0
        public void NoScheduledOrchestrators()
        {
            //arrange
            var orchestrators = new[]
            {
                Get.MotherFor.MockAnarchyActionOrchestrator.OrchestratorWithUnschedulableAction.Build(),
                Get.MotherFor.MockAnarchyActionOrchestrator.OrchestratorWithUnschedulableAction.Build()
            };

            var sut = new AnarchyManagerNew(orchestrators);

            //act
            sut.StartAllSchedules();

            //assert
            foreach (var orchestrator in orchestrators)
            {
                orchestrator.DidNotReceive().Start();
            }
        }