public MainPage() { this.InitializeComponent(); Tests.RunTests(this); var failures = Tests.TestResults.Where(t => !t.Success).ToArray(); var failureCount = failures.Length; this.FailureCount.Text = failureCount.ToString(); this.TestList.ItemsSource = Tests.TestResults; }
void MainPage_Loaded(object sender, RoutedEventArgs e) { try { TestResultsDisplay.ItemsSource = Tests.TestResults; Tests.RunTests(this); var failures = Tests.TestResults.Count(t => !t.Success); NumberOfFailures.Content = failures.ToString(); } catch (Exception ex) { if (Debugger.IsAttached) { Debugger.Break(); } MessageBox.Show(Application.Current.MainWindow, ex.Message, Application.Current.MainWindow.Title + " - " + ex.GetType().FullName, MessageBoxButton.OK); Application.Current.MainWindow.Close(); } }