예제 #1
0
 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);
 }
예제 #2
0
 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);
 }
예제 #3
0
 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);
 }