-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'fixes/osx-multi-monitor-working-area-calc' of github.co…
…m:AvaloniaUI/Avalonia into fixes/osx-multi-monitor-working-area-calc
- Loading branch information
Showing
2 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
tests/Avalonia.Markup.Xaml.UnitTests/Xaml/IgnoredDirectivesTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using Avalonia.Controls; | ||
using Avalonia.Controls.Presenters; | ||
using Avalonia.UnitTests; | ||
using Xunit; | ||
|
||
namespace Avalonia.Markup.Xaml.UnitTests.Xaml | ||
{ | ||
public class IgnoredDirectivesTests : XamlTestBase | ||
{ | ||
[Fact] | ||
public void Ignored_Directives_Should_Compile() | ||
{ | ||
using (UnitTestApplication.Start(TestServices.StyledWindow)) | ||
{ | ||
const string xaml = @" | ||
<Window xmlns='https://github.com/avaloniaui' | ||
xmlns:sys='clr-namespace:System;assembly=netstandard' | ||
xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'> | ||
<TextBlock x:Name='target' x:FieldModifier='Public' Text='Foo'/> | ||
</Window>"; | ||
var window = (Window)AvaloniaRuntimeXamlLoader.Load(xaml); | ||
var target = window.FindControl<TextBlock>("target"); | ||
|
||
window.ApplyTemplate(); | ||
target.ApplyTemplate(); | ||
|
||
Assert.Equal("Foo", target.Text); | ||
} | ||
} | ||
} | ||
} |