public void ValidateSetsStateAndFiresOnValidate() { var validated = false; var task = new TaskStub { OnValidateAction = vl => validated = true }; var validationMock = new Mock<IValidationLog>(); task.Validate(validationMock.Object); Assert.AreEqual(TaskState.Validated, task.State); Assert.IsTrue(validated); }
public void ValidateValidatesFailureActions() { var validated = false; var failureActionStub = new TaskFailureActionStub { OnValidate = vl => validated = true }; var task = new TaskStub(); task.FailureActions.Add(failureActionStub); var validationMock = new Mock<IValidationLog>(); task.Validate(validationMock.Object); Assert.IsTrue(validated); }
public void ValidateValidatesConditions() { var validated = false; var conditionStub = new TaskConditionStub { OnValidate = vl => validated = true }; var task = new TaskStub(); task.Conditions.Add(conditionStub); var validationMock = new Mock<IValidationLog>(); task.Validate(validationMock.Object); Assert.IsTrue(validated); }