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)); }
public void BoxWithNoDependencies_ShouldMatchConditions() { // arrange var b = new BoxJob(); // act // assert Assert.That(b.Condition.Result(), Is.EqualTo(true)); }
public void NewBox_ShouldHaveInactiveState() { // arrange var b = new BoxJob { Name = "Box" }; // assert Assert.That(b.Status, Is.EqualTo(Status.Inactive)); }
public void BoxWithEmptyAndConditions_ShouldMatchConditions() { // arrange var b = new BoxJob { Condition = new AndConditionExpression() }; // act // assert Assert.That(b.Condition.Result(), Is.EqualTo(true)); }