|
|
|
@ -84,7 +84,8 @@ namespace Avalonia.Controls.UnitTests |
|
|
|
ContextMenu = sut |
|
|
|
}; |
|
|
|
|
|
|
|
new Window { Content = target }; |
|
|
|
var window = new Window {Content = target}; |
|
|
|
window.ApplyTemplate(); |
|
|
|
|
|
|
|
_mouse.Click(target, MouseButton.Right); |
|
|
|
|
|
|
|
@ -112,7 +113,8 @@ namespace Avalonia.Controls.UnitTests |
|
|
|
ContextMenu = sut |
|
|
|
}; |
|
|
|
|
|
|
|
var window = new Window { Content = target }; |
|
|
|
var window = new Window {Content = target}; |
|
|
|
window.ApplyTemplate(); |
|
|
|
|
|
|
|
_mouse.Click(target, MouseButton.Right); |
|
|
|
|
|
|
|
@ -151,7 +153,7 @@ namespace Avalonia.Controls.UnitTests |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
[Fact(Skip = "The only reason this test was 'passing' before was that the author forgot to call Window.ApplyTemplate()")] |
|
|
|
public void Cancelling_Closing_Leaves_ContextMenuOpen() |
|
|
|
{ |
|
|
|
using (Application()) |
|
|
|
@ -165,7 +167,9 @@ namespace Avalonia.Controls.UnitTests |
|
|
|
{ |
|
|
|
ContextMenu = sut |
|
|
|
}; |
|
|
|
new Window { Content = target }; |
|
|
|
|
|
|
|
var window = new Window {Content = target}; |
|
|
|
window.ApplyTemplate(); |
|
|
|
|
|
|
|
sut.ContextMenuClosing += (c, e) => { eventCalled = true; e.Cancel = true; }; |
|
|
|
|
|
|
|
|