Example #1
0
        public void HandlesValidChannelMarked()
        {
            var channels = new List<Channel>
            {
                new Channel { Id = "CHANID1" },
                new Channel { Id = "CHANID2", LastRead = "1000" }
            };

            var mockState = SetupChannelsMock(channels);

            var message = new ChannelMarked
            {
                Type = EventType.ChannelMarked,
                Channel = "CHANID2",
                Ts = "1001"
            };

            RunHandler(message, mockState);

            Assert.Equal(2, channels.Count);
            Assert.Equal("1001", channels.First(c => c.Id == "CHANID2").LastRead);
        }
Example #2
0
        private void ChannelMarked(ChannelMarked message)
        {
            var channel = base.BotState.Channels.FirstOrDefault(c => c.Id == message.Channel);

            if (channel == null)
                return;

            channel.LastRead = message.Ts;
        }