Ejemplo n.º 1
0
        public void HandlesValidChannelLeft()
        {
            var channels = new List<Channel>
            {
                new Channel { Id = "CHANID1", IsMember = false },
                new Channel { Id = "CHANID2", IsMember = true }
            };

            var mockState = SetupChannelsMock(channels);

            var message = new ChannelLeft
            {
                Type = EventType.ChannelLeft,
                Channel = "CHANID2"
            };

            RunHandler(message, mockState);

            Assert.True(channels.All(c => c.IsMember == false));
        }
Ejemplo n.º 2
0
        private void ChannelLeft(ChannelLeft message)
        {
            var channel = base.BotState.Channels.FirstOrDefault(c => c.Id == message.Channel);

            if (channel == null)
                return;

            channel.IsMember = false;
        }