Ejemplo n.º 1
0
        public void PutChannelsChannelIdSubscriptionsTest()
        {
            // TODO: add unit test for the method 'PutChannelsChannelIdSubscriptions'
            string channelId         = null; // TODO: replace null with proper value
            List <ChannelTopic> body = null; // TODO: replace null with proper value
            var response             = instance.PutChannelsChannelIdSubscriptions(channelId, body);

            Assert.IsInstanceOf <ChannelTopicEntityListing> (response, "response is ChannelTopicEntityListing");
        }
        /// <summary>
        /// Removes the subscribed topic
        /// </summary>
        /// <param name="topic">The notification topic to remove</param>
        public void RemoveSubscription(string topic)
        {
            var subscriptions = _notificationsApi.GetChannelsChannelIdSubscriptions(Channel.Id);
            var match         =
                subscriptions.Entities.FirstOrDefault(
                    e => e.Id.Equals(topic, StringComparison.InvariantCultureIgnoreCase));

            if (match == null)
            {
                return;
            }
            subscriptions.Entities.Remove(match);
            _notificationsApi.PutChannelsChannelIdSubscriptions(Channel.Id, subscriptions.Entities);
            _typeMap.Remove(topic);
        }