private void FailOnDestroy() { try { stateManager.Destroy(); Assert.Fail(); } catch (IllegalStateTransitionException) { // Expected } }
/// <summary> /// Dispose the Adapter, stopping the sending of all events and releasing all /// the resources, and disallowing any further state changes on the Adapter. /// </summary> /// <throws>EPException to indicate errors during destroy</throws> public virtual void Destroy() { var tempSender = Interlocked.Exchange(ref _sender, null); if (tempSender != null) { tempSender.OnFinish(); } StateManager.Destroy(); Close(); }