public void RemovePropertyChanged() { var obj = new PropertyChangedEventObject { StringValue = "Hello", }; var left = ""; var b = Binding.Create(() => left == obj.StringValue); Assert.AreEqual(1, obj.StringValueChangedCount); Assert.AreEqual(obj.StringValue, left); obj.StringValue = "Goodbye"; Assert.AreEqual(obj.StringValue, left); b.Unbind(); Assert.AreEqual(0, obj.StringValueChangedCount); obj.StringValue = "Hello Again"; Assert.AreEqual("Goodbye", left); }
public void PropertyChanged() { var obj = new PropertyChangedEventObject { StringValue = "Hello", }; var left = ""; Binding.Create(() => left == obj.StringValue); Assert.AreEqual(1, obj.StringValueChangedCount); Assert.AreEqual(obj.StringValue, left); obj.StringValue = "Goodbye"; Assert.AreEqual(obj.StringValue, left); }
public void ComplexPropertyChanged() { var obj = new PropertyChangedEventObject { StringValue = "Hello", }; var leftA = true; Binding.Create (() => leftA == string.IsNullOrEmpty(obj.StringValue)); Assert.AreEqual (1, obj.StringValueChangedCount); Assert.AreEqual (false, leftA); obj.StringValue = ""; Assert.AreEqual (true, leftA); }
public void MultiplePropertyChanged() { var obj = new PropertyChangedEventObject { StringValue = "Hello", }; var leftA = ""; var leftB = ""; Binding.Create(() => leftA == obj.StringValue); Binding.Create(() => leftB == obj.StringValue + "..."); Assert.AreEqual(1, obj.StringValueChangedCount); Assert.AreEqual("Hello", leftA); Assert.AreEqual("Hello...", leftB); obj.StringValue = "Goodbye"; Assert.AreEqual("Goodbye", leftA); Assert.AreEqual("Goodbye...", leftB); }
public void MultiplePropertyChanged() { var obj = new PropertyChangedEventObject { StringValue = "Hello", }; var leftA = ""; var leftB = ""; Binding.Create (() => leftA == obj.StringValue); Binding.Create (() => leftB == obj.StringValue + "..."); Assert.AreEqual (1, obj.StringValueChangedCount); Assert.AreEqual ("Hello", leftA); Assert.AreEqual ("Hello...", leftB); obj.StringValue = "Goodbye"; Assert.AreEqual ("Goodbye", leftA); Assert.AreEqual ("Goodbye...", leftB); }
public void MultipleObjectPropertyChanged() { var objA = new PropertyChangedEventObject { StringValue = "Hello", }; var objB = new PropertyChangedEventObject { StringValue = "World", }; var left = ""; Binding.Create(() => left == objA.StringValue + ", " + objB.StringValue); Assert.AreEqual("Hello, World", left); objA.StringValue = "Goodbye"; Assert.AreEqual("Goodbye, World", left); objB.StringValue = "Mars"; Assert.AreEqual("Goodbye, Mars", left); }
public void RemoveMultiplePropertyChanged() { var obj = new PropertyChangedEventObject { StringValue = "Hello", }; var leftA = ""; var leftB = ""; var bA = Binding.Create(() => leftA == obj.StringValue); var bB = Binding.Create(() => leftB == obj.StringValue + "..."); Assert.AreEqual(1, obj.StringValueChangedCount); Assert.AreEqual("Hello", leftA); Assert.AreEqual("Hello...", leftB); obj.StringValue = "Goodbye"; Assert.AreEqual("Goodbye", leftA); Assert.AreEqual("Goodbye...", leftB); bA.Unbind(); Assert.AreEqual(1, obj.StringValueChangedCount); obj.StringValue = "Hello Again"; Assert.AreEqual("Goodbye", leftA); Assert.AreEqual("Hello Again...", leftB); bB.Unbind(); Assert.AreEqual(0, obj.StringValueChangedCount); obj.StringValue = "Goodbye Again"; Assert.AreEqual("Goodbye", leftA); Assert.AreEqual("Hello Again...", leftB); }
public void MultipleObjectPropertyChanged() { var objA = new PropertyChangedEventObject { StringValue = "Hello", }; var objB = new PropertyChangedEventObject { StringValue = "World", }; var left = ""; Binding.Create (() => left == objA.StringValue + ", " + objB.StringValue); Assert.AreEqual ("Hello, World", left); objA.StringValue = "Goodbye"; Assert.AreEqual ("Goodbye, World", left); objB.StringValue = "Mars"; Assert.AreEqual ("Goodbye, Mars", left); }
public void RemovePropertyChanged() { var obj = new PropertyChangedEventObject { StringValue = "Hello", }; var left = ""; var b = Binding.Create (() => left == obj.StringValue); Assert.AreEqual (1, obj.StringValueChangedCount); Assert.AreEqual (obj.StringValue, left); obj.StringValue = "Goodbye"; Assert.AreEqual (obj.StringValue, left); b.Unbind (); Assert.AreEqual (0, obj.StringValueChangedCount); obj.StringValue = "Hello Again"; Assert.AreEqual ("Goodbye", left); }
public void RemoveMultiplePropertyChanged() { var obj = new PropertyChangedEventObject { StringValue = "Hello", }; var leftA = ""; var leftB = ""; var bA = Binding.Create (() => leftA == obj.StringValue); var bB = Binding.Create (() => leftB == obj.StringValue + "..."); Assert.AreEqual (1, obj.StringValueChangedCount); Assert.AreEqual ("Hello", leftA); Assert.AreEqual ("Hello...", leftB); obj.StringValue = "Goodbye"; Assert.AreEqual ("Goodbye", leftA); Assert.AreEqual ("Goodbye...", leftB); bA.Unbind (); Assert.AreEqual (1, obj.StringValueChangedCount); obj.StringValue = "Hello Again"; Assert.AreEqual ("Goodbye", leftA); Assert.AreEqual ("Hello Again...", leftB); bB.Unbind (); Assert.AreEqual (0, obj.StringValueChangedCount); obj.StringValue = "Goodbye Again"; Assert.AreEqual ("Goodbye", leftA); Assert.AreEqual ("Hello Again...", leftB); }
public void PropertyChanged() { var obj = new PropertyChangedEventObject { StringValue = "Hello", }; var left = ""; Binding.Create (() => left == obj.StringValue); Assert.AreEqual (1, obj.StringValueChangedCount); Assert.AreEqual (obj.StringValue, left); obj.StringValue = "Goodbye"; Assert.AreEqual (obj.StringValue, left); }