Ejemplo n.º 1
0
        public void SetBindingTwice()
        {
            using(var button = new TestButton()) {
                button.SetDataContext("test");
                button.SetBinding("Text2", new Binding());
                button.SetBinding("Text2", new Binding());
                Assert.That(button.Text2, Is.EqualTo("test"));
                Assert.That(button.Text2SetCount, Is.EqualTo(1));

                button.SetDataContext("test2");
                Assert.That(button.Text2, Is.EqualTo("test2"));
                Assert.That(button.Text2SetCount, Is.EqualTo(2));
            }
        }
Ejemplo n.º 2
0
 public void NoExtraBindingUpdates()
 {
     using(var button = new TestButton()) {
         button.SetDataContext("test");
         button.SetBinding("Text2", new Binding());
         Assert.That(button.Text2SetCount, Is.EqualTo(1));
         button.SetDataContext("test");
         Assert.That(button.Text2SetCount, Is.EqualTo(1));
     }
 }