Exemplo n.º 1
0
 void Ex01()
 {
     When("the property validation is enabled", () => PropertyNotAttributedValidation.EnableValidation(() => PropertyNotAttributedValidation));
     When("the value is set", () => SetValue("Changed", PropertyNotAttributedValidation));
     Then("the ErrorsChanged event should not be raised", () => !ErrorsChangedRaised);
     AssertNoValidationError(PropertyNotAttributedValidation);
 }
Exemplo n.º 2
0
 void Ex08()
 {
     When("the property validation is enabled", () => PropertyNotAttributedValidation.EnableValidation(() => PropertyNotAttributedValidation));
     When("the PropertyValueValidate event handler is added", () => PropertyNotAttributedValidation.PropertyValueValidate += PropertyValueValidateHandler);
     When("the invalid value is set", () => SetValue("Incorrect", PropertyNotAttributedValidation));
     Then("the ErrorsChanged event should be raised", () => ErrorsChangedRaised);
     AssertValidationError(PropertyNotAttributedValidation, "The value does not correct.");
 }