void Ex01() { When("the property1 binds the property2", () => Property1.Bind(Property2)); Then("the value of the property1 should be the value of the property2", () => Property1.Value == "Test2"); Then("the value of the property2 should not be changed", () => Property2.Value == "Test2"); When("the value of the property2 is changed", () => Property2.Value = "Changed"); Then("the value of the property1 should be the changed value", () => Property1.Value == "Changed"); Then("the value of the property2 should be the changed value", () => Property2.Value == "Changed"); }
void Ex01() { When("the property1 binds the property2 with a converter", () => Property1.Bind(Property2, value => value.ToString())); Then("the value of the property1 should be the converted value of the property2", () => Property1.Value == "3"); Then("the value of the property2 should not be changed", () => Property2.Value == 3); When("the value of the property2 is changed", () => Property2.Value = 7); Then("the value of the property1 should be the changed value that is converted", () => Property1.Value == "7"); Then("the value of the property2 should be the changed value", () => Property2.Value == 7); }
void Ex03() { When("the property1 bind the property2", () => Property1.Bind(Property2)); When("the property1 binds another property", () => Property1.Bind(ObservableProperty <string> .Of("Test"))); Then <InvalidOperationException>($"{typeof(InvalidOperationException)} should be thrown"); }
void Ex03() { When("the property1 binds the property2 with a converter", () => Property1.Bind(Property2, value => value.ToString())); When("the property1 binds another property with a converter", () => Property1.Bind(ObservableProperty <int> .Of(7), value => value.ToString())); Then <InvalidOperationException>($"{typeof(InvalidOperationException)} should be thrown"); }
void Ex05() { When("the property1 binds the property2 with a converter that is null", () => Property1.Bind(Property2, null)); Then <ArgumentNullException>($"{typeof(ArgumentNullException)} should be thrown"); }
void Ex04() { When("the property1 binds the property that is null with a converter", () => Property1.Bind((ObservableProperty <int>)null, value => value.ToString())); Then <ArgumentNullException>($"{typeof(ArgumentNullException)} should be thrown"); }
void Ex05() { When("the property1 binds the property that is null", () => Property1.Bind((ObservableProperty<string>)null)); Then<ArgumentNullException>($"{typeof(ArgumentNullException)} should be thrown"); }