public void CheckReturnsRequestIfAnyChildSetWithOr() { var child1 = new TriggerStub { OnCheckAction = () => null }; var child2 = new TriggerStub { OnCheckAction = () => new IntegrationRequest("Dummy") }; var trigger = new Multiple(child1, child2); var actual = trigger.Check(); Assert.IsNotNull(actual); Assert.AreEqual("Multiple", actual.SourceTrigger); }
public void CheckReturnsRequestIfAllChildrenSetWithAnd() { var child1 = new TriggerStub { OnCheckAction = () => new IntegrationRequest("Dummy") }; var child2 = new TriggerStub { OnCheckAction = () => new IntegrationRequest("Dummy") }; var trigger = new Multiple(child1, child2) { Condition = CombinationOperator.And }; var actual = trigger.Check(); Assert.IsNotNull(actual); Assert.AreEqual("Multiple", actual.SourceTrigger); }
public void CheckReturnsNullIfAllChildrenNullWithOr() { var child1 = new TriggerStub { OnCheckAction = () => null }; var child2 = new TriggerStub { OnCheckAction = () => null }; var trigger = new Multiple(child1, child2); var actual = trigger.Check(); Assert.IsNull(actual); }
public void CheckReturnsNullIfAnyChildNullWithAnd() { var child1 = new TriggerStub { OnCheckAction = () => null }; var child2 = new TriggerStub { OnCheckAction = () => new IntegrationRequest("Dummy") }; var trigger = new Multiple(child1, child2) { Condition = CombinationOperator.And }; var actual = trigger.Check(); Assert.IsNull(actual); }