Browse Source

Added failing test for #4403.

pull/4446/head
Steven Kirk 6 years ago
parent
commit
472352558f
  1. 15
      tests/Avalonia.Styling.UnitTests/SetterTests.cs

15
tests/Avalonia.Styling.UnitTests/SetterTests.cs

@ -35,6 +35,21 @@ namespace Avalonia.Styling.UnitTests
Assert.Equal("foo", control.Text); Assert.Equal("foo", control.Text);
} }
[Fact]
public void Setter_Should_Handle_Binding_Producing_UnsetValue()
{
var control = new TextBlock();
var subject = new BehaviorSubject<object>(AvaloniaProperty.UnsetValue);
var descriptor = InstancedBinding.OneWay(subject);
var binding = Mock.Of<IBinding>(x => x.Initiate(control, TextBlock.TagProperty, null, false) == descriptor);
var style = Mock.Of<IStyle>();
var setter = new Setter(TextBlock.TagProperty, binding);
setter.Instance(control).Start(false);
Assert.Equal("", control.Text);
}
[Fact] [Fact]
public void Setter_Should_Materialize_Template_To_Property() public void Setter_Should_Materialize_Template_To_Property()
{ {

Loading…
Cancel
Save