Пример #1
0
        public void window_command_exit_application_should_be_handle_by_command_bus()
        {
            var exitApplicationCommand = new ExitApplicationCommand(commandBus, null);

            exitApplicationCommand.Execute(null);

            exitCode.ShouldBe(0);
        }
Пример #2
0
        private void Minefield_GameEnded(object sender, Minefield.GameEndedEventArgs e)
        {
            MessageBoxResult result;

            if (e.IsWon)
            {
                result = dialogService.Show(Loc.MainWindow_Message_GameWon_Text, Loc.MainWindow_Message_GameWon_Title, MessageBoxButton.YesNo, MessageBoxImage.Exclamation);
            }
            else
            {
                result = dialogService.Show(Loc.MainWindow_Message_GameLost_Text, Loc.MainWindow_Message_GameLost_Title, MessageBoxButton.YesNo, MessageBoxImage.Hand);
            }

            if (result == MessageBoxResult.No)
            {
                ExitApplicationCommand.Execute(null);
            }
            else if (result == MessageBoxResult.Yes)
            {
                RestartGameCommand.Execute(null);
            }
        }