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); }
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."); }