public void ValidateRaisesAnErrorIfNullChildConditionsDefined() { var processor = this.mocks.Create <IConfigurationErrorProcesser>(MockBehavior.Strict).Object; Mock.Get(processor).Setup(_processor => _processor.ProcessError( "Validation failed for orCondition - at least one child condition must be supplied")).Verifiable(); var condition = new OrTaskCondition(); condition.Validate(null, null, processor); this.mocks.VerifyAll(); }
public void ValidateRaisesAnErrorIfNullChildConditionsDefined() { var processor = this.mocks.StrictMock <IConfigurationErrorProcesser>(); Expect.Call(() => processor.ProcessError( "Validation failed for orCondition - at least one child condition must be supplied")); this.mocks.ReplayAll(); var condition = new OrTaskCondition(); condition.Validate(null, null, processor); this.mocks.VerifyAll(); }
public void ValidateCallsChildrenValidation() { var processor = this.mocks.Create <IConfigurationErrorProcesser>(MockBehavior.Strict).Object; var validateCalled = false; var childCondition = new MockCondition { ValidateAction = (c, t, ep) => validateCalled = true }; var condition = new OrTaskCondition { Conditions = new[] { childCondition } }; condition.Validate(null, ConfigurationTrace.Start(this), processor); this.mocks.VerifyAll(); Assert.IsTrue(validateCalled); }