コード例 #1
0
        public void Store_And_Leave_And_Publish_Assert_Was_Not_Called_Test()
        {
            // 2) act
            eventConteiner.Store(pluginName, e);
            eventConteiner.Leave(pluginName);
            eventConteiner.Publish(pluginName, publisher);

            // 3) assert
            publisher.AssertWasNotCalled((x => x.Publish(e)));
        }
        /// <summary>
        /// Remove callback object form dictionary.
        /// </summary>
        public void UnsubscribePlugin(string name)
        {
            lock (syncLock)
            {
                try
                {
                    if (pluginSubscribers.ContainsKey(name) == false)
                    {
                        return;
                    }

                    unpublishedEvents.Leave(name);
                    pluginSubscribers.Remove(name);
                }
                catch (Exception ex)
                {
                    errorHandler.OnUnsubscriptionFailed(name, ex);
                }
            }
        }