Sfoglia il codice sorgente

Failing test for bug #3170

mstr2 6 anni fa
parent
commit
5fea821c94

+ 12 - 0
tests/Avalonia.Base.UnitTests/AvaloniaObjectTests_Validation.cs

@@ -78,6 +78,18 @@ namespace Avalonia.Base.UnitTests
             Assert.Equal(10, target.GetValue(Class1.AttachedProperty));
         }
 
+        [Fact]
+        public void PropertyChanged_Event_Uses_Coerced_Value()
+        {
+            var inst = new Class1();
+            inst.PropertyChanged += (sender, e) =>
+            {
+                Assert.Equal(10, e.NewValue);
+            };
+
+            inst.SetValue(Class1.QuxProperty, 15);
+        }
+
         private class Class1 : AvaloniaObject
         {
             public static readonly StyledProperty<int> QuxProperty =