示例#1
0
文件: Class1.cs 项目: azhozhin/asysx
        public void BoxWithOneCmdAndEmptyConditions_OnForceStartJob_ShouldHaveAllChildrenActivated()
        {
            // arrange
            var mainBox = new BoxJob {
                Name = "MainBox"
            };
            var childBox = new BoxJob {
                Name = "ChildBox"
            };
            var grandChildCmd = new CmdJob {
                Name = "Child"
            };

            mainBox.ChildJobs.Add(childBox);
            childBox.ChildJobs.Add(grandChildCmd);

            var eventProcessor = new EventProcessor();

            // act
            eventProcessor.ProcessEvent(mainBox, Event.ForceStartJob);

            // assert
            Assert.That(mainBox.Status, Is.EqualTo(Status.Running));
            Assert.That(childBox.Status, Is.EqualTo(Status.Activated));
            Assert.That(grandChildCmd.Status, Is.EqualTo(Status.Activated));
        }
示例#2
0
文件: Class1.cs 项目: azhozhin/asysx
        public void BoxWithNoDependencies_ShouldMatchConditions()
        {
            // arrange
            var b = new BoxJob();

            // act
            // assert
            Assert.That(b.Condition.Result(), Is.EqualTo(true));
        }
示例#3
0
文件: Class1.cs 项目: azhozhin/asysx
        public void NewBox_ShouldHaveInactiveState()
        {
            // arrange
            var b = new BoxJob {
                Name = "Box"
            };

            // assert
            Assert.That(b.Status, Is.EqualTo(Status.Inactive));
        }
示例#4
0
文件: Class1.cs 项目: azhozhin/asysx
        public void BoxWithEmptyAndConditions_ShouldMatchConditions()
        {
            // arrange
            var b = new BoxJob {
                Condition = new AndConditionExpression()
            };

            // act
            // assert
            Assert.That(b.Condition.Result(), Is.EqualTo(true));
        }