public void WindowVisibilityChangedEventEmit() { tlog.Debug(tag, $"WindowVisibilityChangedEventEmit START"); var currentPid = global::System.Diagnostics.Process.GetCurrentProcess().Id; var currentTid = global::System.Threading.Thread.CurrentThread.ManagedThreadId; tlog.Debug(tag, $"thread check! main pid={App.mainPid}, current pid={currentPid}, main tid={App.mainTid}, current tid={currentTid}"); using (Window window = new Window(new Rectangle(0, 0, 2, 2), false)) { var testingTarget = new WindowVisibilityChangedEvent(Window.Instance); Assert.IsNotNull(testingTarget, "Should be not null!"); Assert.IsInstanceOf <WindowVisibilityChangedEvent>(testingTarget, "Should be an Instance of WindowVisibilityChangedEvent!"); try { testingTarget.Emit(window, false); } catch (Exception e) { tlog.Debug(tag, e.Message.ToString()); Assert.Fail("Caught Exception: Failed!"); } testingTarget.Dispose(); } tlog.Debug(tag, $"WindowVisibilityChangedEventEmit END (OK)"); }