Пример #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();
                }
            }
        }
Пример #2
0
        public void NoOrchestrators()
        {
            //arrange
            var sut = new AnarchyManagerNew(new IActionOrchestrator[] {  });

            //act/assert
            Assert.DoesNotThrow(() => sut.StartAllSchedules());
        }
Пример #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();
            }
        }