Browse Source

Added failing test.

pull/464/head
Steven Kirk 10 years ago
parent
commit
a9f5fac632
  1. 22
      tests/Perspex.Markup.Xaml.UnitTests/Xaml/StyleTests.cs

22
tests/Perspex.Markup.Xaml.UnitTests/Xaml/StyleTests.cs

@ -150,5 +150,27 @@ namespace Perspex.Markup.Xaml.UnitTests.Xaml
Assert.Equal(0xff506070, buttonBrush.Color.ToUint32());
}
}
[Fact]
public void StyleResource_Can_Be_Found_In_TopLevel_Styles()
{
var xaml = @"
<Styles xmlns='https://github.com/perspex'
xmlns:mut='https://github.com/perspex/mutable'
xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'>
<Style>
<Style.Resources>
<Color x:Key='color'>#ff506070</Color>
<mut:SolidColorBrush x:Key='brush' Color='{StyleResource color}'/>
</Style.Resources>
</Style>
</Styles>";
var loader = new PerspexXamlLoader();
var styles = (Styles)loader.Load(xaml);
var brush = (Perspex.Media.Mutable.SolidColorBrush)styles.FindResource("brush");
Assert.Equal(0xff506070, brush.Color.ToUint32());
}
}
}

Loading…
Cancel
Save