public void Initialize_CallingInitializeBeforeSettingCompleteHandler_ThrowsException() { Assert.ThrowsException <OpenFinInitializationException>(() => { if (DesktopAgent.InitializationComplete != null) { DesktopAgent.InitializationComplete = null; } DesktopAgent.Initialize(); }); }
private void init() { if (DesktopAgent.InitializationComplete == null) { var tcs = new TaskCompletionSource <object>(); DesktopAgent.InitializationComplete += ex => { tcs.SetResult(null); }; DesktopAgent.Initialize(); tcs.Task.Wait(); } }