Example #1
0
        private void ChannelJoined(ChannelJoined message)
        {
            var createdMessage = new ChannelCreated
            {
                Channel = message.Channel
            };

            ChannelCreated(createdMessage);
        }
Example #2
0
        public void HandlesValidChannelJoined()
        {
            var channels = new List<Channel>
            {
                new Channel { Id = "CHANID1", IsMember = false },
                new Channel { Id = "CHANID2", IsMember = true }
            };

            var mockState = SetupChannelsMock(channels);

            var message = new ChannelJoined
            {
                Type = EventType.ChannelJoined,
                Channel = new Channel {  Id = "CHANID1", IsMember = true }
            };

            RunHandler(message, mockState);

            Assert.True(channels.All(c => c.IsMember));
        }