added tray menu
This commit is contained in:
@@ -265,6 +265,28 @@ public sealed class MainWindowTests
|
||||
});
|
||||
}
|
||||
|
||||
// The application lives in the tray, and the settings window is a guest on the
|
||||
// screen: its close button puts it away rather than ends anything
|
||||
[Fact]
|
||||
public void The_window_hooks_up_to_the_tray()
|
||||
{
|
||||
Sta.Run(() =>
|
||||
{
|
||||
using SettingsViewModel viewModel = CreateViewModel();
|
||||
|
||||
Open(viewModel, window =>
|
||||
{
|
||||
window.Close();
|
||||
|
||||
Assert.False(window.IsVisible);
|
||||
|
||||
// A closed window would refuse this
|
||||
window.Show();
|
||||
Assert.True(window.IsVisible);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void The_window_hooks_up_to_the_placement()
|
||||
{
|
||||
@@ -305,7 +327,9 @@ public sealed class MainWindowTests
|
||||
MainWindowPlacement placement,
|
||||
Action<MainWindow> check)
|
||||
{
|
||||
var window = new MainWindow(viewModel, theme, placement)
|
||||
var presenter = new MainWindowPresenter(placement);
|
||||
|
||||
var window = new MainWindow(viewModel, theme, placement, presenter)
|
||||
{
|
||||
// The window is needed alive, but not in sight
|
||||
Opacity = 0,
|
||||
@@ -322,6 +346,9 @@ public sealed class MainWindowTests
|
||||
}
|
||||
finally
|
||||
{
|
||||
// The window belongs to the tray now and refuses to close until
|
||||
// the application is on its way out
|
||||
presenter.AllowClose();
|
||||
window.Close();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user