public void AddControl_DifferentThread_ThrowsException() { var form = new DummyForm(); ExecuteInThread(() => form.AddControl(new Button())); Assert.IsNotNull(uncaughtException, "Expected an exception"); uncaughtException = null; var classInCtx = new ClassUsingFormInWindowsContext(); ExecuteInThread(() => classInCtx.DoWork(form)); Assert.IsNotNull(uncaughtException, "Expected an exception"); }