public void When_DefaultBindingMode_TwoWay() { var SUT = new Binding_DefaultBindMode(); Assert.IsNull(SUT.Default_TwoWay_Property); Assert.IsNull(SUT.Default_TwoWay_OneWay_Property); Assert.IsNull(SUT.Default_TwoWay_TwoWay_Property); SUT.Default_TwoWay_Property = "TwoWay updated 1"; SUT.Default_TwoWay_OneWay_Property = "TwoWay updated 2"; SUT.Default_TwoWay_TwoWay_Property = "TwoWay updated 3"; SUT.ForceLoaded(); Assert.AreEqual("TwoWay updated 1", SUT.Default_TwoWay.Text); Assert.AreEqual("TwoWay updated 2", SUT.Default_TwoWay_OneWay.Text); Assert.AreEqual("TwoWay updated 3", SUT.Default_TwoWay_TwoWay.Text); SUT.Default_TwoWay_Property = "TwoWay updated 4"; SUT.Default_TwoWay_OneWay_Property = "TwoWay updated 5"; SUT.Default_TwoWay_TwoWay_Property = "TwoWay updated 6"; Assert.AreEqual("TwoWay updated 4", SUT.Default_TwoWay.Text); Assert.AreEqual("TwoWay updated 5", SUT.Default_TwoWay_OneWay.Text); Assert.AreEqual("TwoWay updated 6", SUT.Default_TwoWay_TwoWay.Text); SUT.Default_TwoWay.Text = "TwoWay updated 7"; SUT.Default_TwoWay_OneWay.Text = "TwoWay updated 8"; SUT.Default_TwoWay_TwoWay.Text = "TwoWay updated 9"; Assert.AreEqual("TwoWay updated 7", SUT.Default_TwoWay_Property); Assert.AreEqual("TwoWay updated 5", SUT.Default_TwoWay_OneWay_Property); Assert.AreEqual("TwoWay updated 9", SUT.Default_TwoWay_TwoWay_Property); }
public void When_DefaultBindingMode_Nested() { var SUT = new Binding_DefaultBindMode(); Assert.IsNull(SUT.Nested_Default_1_Property); Assert.IsNull(SUT.Nested_Default_2_Property); Assert.IsNull(SUT.Nested_Default_OneWay_OneWay_Property); Assert.IsNull(SUT.Nested_Default_OneWay_TwoWay_Property); Assert.IsNull(SUT.Nested_Default_OneWay_OneTime_Property); SUT.Nested_Default_1_Property = "nested updated 1"; SUT.Nested_Default_2_Property = "nested updated 2"; SUT.Nested_Default_OneWay_OneWay_Property = "nested updated 3"; SUT.Nested_Default_OneWay_TwoWay_Property = "nested updated 4"; SUT.Nested_Default_OneWay_OneTime_Property = "nested updated 41"; SUT.ForceLoaded(); Assert.AreEqual("nested updated 1", SUT.Nested_Default_1.Text); Assert.AreEqual("nested updated 2", SUT.Nested_Default_2.Text); Assert.AreEqual("nested updated 3", SUT.Nested_Default_OneWay_OneWay.Text); Assert.AreEqual("nested updated 4", SUT.Nested_Default_OneWay_TwoWay.Text); Assert.AreEqual("nested updated 41", SUT.Nested_Default_OneWay_OneTime.Text); SUT.Nested_Default_1_Property = "nested updated 5"; SUT.Nested_Default_2_Property = "nested updated 6"; SUT.Nested_Default_OneWay_OneWay_Property = "nested updated 7"; SUT.Nested_Default_OneWay_TwoWay_Property = "nested updated 8"; SUT.Nested_Default_OneWay_OneTime_Property = "nested updated 81"; Assert.AreEqual("nested updated 5", SUT.Nested_Default_1.Text); Assert.AreEqual("nested updated 6", SUT.Nested_Default_2.Text); Assert.AreEqual("nested updated 7", SUT.Nested_Default_OneWay_OneWay.Text); Assert.AreEqual("nested updated 8", SUT.Nested_Default_OneWay_TwoWay.Text); Assert.AreEqual("nested updated 41", SUT.Nested_Default_OneWay_OneTime.Text); SUT.Nested_Default_1.Text = "nested updated 9"; SUT.Nested_Default_2.Text = "nested updated 10"; SUT.Nested_Default_OneWay_OneWay.Text = "nested updated 11"; SUT.Nested_Default_OneWay_TwoWay.Text = "nested updated 12"; SUT.Nested_Default_OneWay_OneTime.Text = "nested updated 121"; Assert.AreEqual("nested updated 9", SUT.Nested_Default_1_Property); Assert.AreEqual("nested updated 6", SUT.Nested_Default_2_Property); Assert.AreEqual("nested updated 7", SUT.Nested_Default_OneWay_OneWay_Property); Assert.AreEqual("nested updated 12", SUT.Nested_Default_OneWay_TwoWay_Property); Assert.AreEqual("nested updated 81", SUT.Nested_Default_OneWay_OneTime_Property); }