/// <summary>
        ///     Sends the specified message (Synchronously).
        /// </summary>
        /// <param name="message">The message.</param>
        /// <exception cref="System.ArgumentNullException">message</exception>
        /// <exception cref="System.InvalidOperationException">Channel is disposing.</exception>
        public void Send(ExecutionStatusCallbackMessage message)
        {
            if (message == null)
            {
                throw new ArgumentNullException("message");
            }

            lock (_disposeGuard)
            {
                if (_isDisposed)
                {
                    throw new InvalidOperationException("Channel is disposing.");
                }
            }

            Action <ExecutionStatusCallbackMessage> callback;

            if (_callbacks.TryGetValue(message.CallbackID, out callback))
            {
                callback(message);
            }
        }
        public void Send_Where_MessageDoesntHaveCallbackRegistered_Expect_CallbackNotInvoked()
        {
            ExecutionStatusCallbackDispatcher _executionStatusCallbackDispatcher = new ExecutionStatusCallbackDispatcher();

            bool expected = false;
            bool actual = false;

            Guid guid = Guid.NewGuid();
            Action<ExecutionStatusCallbackMessage> callback = m => { actual = true; };
            ExecutionStatusCallbackMessage message = new ExecutionStatusCallbackMessage(Guid.NewGuid(), ExecutionStatusCallbackMessageType.Unknown);

            _executionStatusCallbackDispatcher.Add(guid, callback);
            _executionStatusCallbackDispatcher.Send(message);

            Assert.AreEqual(expected, actual);
        }
        /// <summary>
        ///     Sends the specified message (Synchronously).
        /// </summary>
        /// <param name="message">The message.</param>
        /// <exception cref="System.ArgumentNullException">message</exception>
        /// <exception cref="System.InvalidOperationException">Channel is disposing.</exception>
        public void Send(ExecutionStatusCallbackMessage message)
        {
            if (message == null)
            {
                throw new ArgumentNullException("message");
            }

            lock (_disposeGuard)
            {
                if (_isDisposed)
                {
                    throw new InvalidOperationException("Channel is disposing.");
                }
            }

            Action<ExecutionStatusCallbackMessage> callback;
            if (_callbacks.TryGetValue(message.CallbackID, out callback))
            {
                callback(message);
            }
        }