Пример #1
0
        public void HandlesValidGroupMarked()
        {
            var groups = new List <Group>
            {
                new Group {
                    Id = "CHANID1"
                },
                new Group {
                    Id = "CHANID2", LastRead = "1000"
                }
            };

            var mockState = SetupGroupsMock(groups);

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

            RunHandler(message, mockState);

            Assert.Equal(2, groups.Count);
            Assert.Equal("1001", groups.First(c => c.Id == "CHANID2").LastRead);
        }
Пример #2
0
        private void GroupMarked(GroupMarked message)
        {
            var group = base.BotState.Groups.FirstOrDefault(c => c.Id == message.Channel);

            if (group == null)
            {
                return;
            }

            group.LastRead = message.Ts;
        }