public void Initialize() { this.initial = AsyncTaskCallInAdapter.ReleaseComObjectWrapperInstance; Assert.IsInstanceOfType(this.initial, typeof(AsyncTaskCallInAdapter.ReleaseComObjectWrapper), "Release Com Object Wrapper Instance on the call in adapter is not set"); this.releaseComObjectStub = new ReleaseComObjectWrapperStub(); AsyncTaskCallInAdapter.ReleaseComObjectWrapperInstance = this.releaseComObjectStub; this.stub = new NativeStub(); this.asyncEvent = new ManualResetEventSlim(); this.asyncEvent.Reset(); this.baseTask = Task.Factory.StartNew(() => this.asyncEvent.Wait()); }
public void Cleanup() { AsyncTaskCallInAdapter.ReleaseComObjectWrapperInstance = this.initial; this.initial = null; }