public AutomationTestBase() { TestHost.Initialize(); var message = $"Create test class '{this.GetType().Name}' with Thread.CurrentThread: {Thread.CurrentThread.ManagedThreadId}" + $" and Current.Dispatcher.Thread: {Application.Current.Dispatcher.Thread.ManagedThreadId}"; Debug.WriteLine(message); // Reset the application as good as we can Application.Current.Invoke(() => { var windows = Application.Current.Windows.OfType <Window>().ToList(); foreach (Window window in windows) { window.Close(); } }); Application.Current.Invoke(() => { var accent = ThemeManager.Accents.First(x => x.Name == "Blue"); var theme = ThemeManager.GetAppTheme("BaseLight"); ThemeManager.ChangeAppStyle(Application.Current, accent, theme); }); }
public AutomationTestBase() { TestHost.Initialize(); // Reset the application as good as we can Application.Current.Dispatcher.Invoke(new Action(() => { foreach (Window window in Application.Current.Windows) { window.Close(); } })); Application.Current.Dispatcher.Invoke(new Action(() => { var accent = ThemeManager.Accents.First(x => x.Name == "Blue"); var theme = ThemeManager.GetAppTheme("BaseLight"); ThemeManager.ChangeAppStyle(Application.Current, accent, theme); })); }
public ApplicationFixture() { // ... initialize TestHost.Initialize(); }