示例#1
0
        public void HandlesValidGroupUnarchive()
        {
            var groups = new List <Group>
            {
                new Group {
                    Id = "CHANID1", IsArchived = true
                },
                new Group {
                    Id = "CHANID2", IsArchived = false
                }
            };

            var mockState = SetupGroupsMock(groups);

            var message = new GroupUnarchive
            {
                Type    = EventType.GroupUnarchive,
                Channel = "CHANID1"
            };

            RunHandler(message, mockState);

            Assert.Equal(2, groups.Count);
            Assert.Equal(false, groups.First(c => c.Id == "CHANID1").IsArchived);
            Assert.Equal(false, groups.First(c => c.Id == "CHANID2").IsArchived);
        }
示例#2
0
        private void GroupUnarchive(GroupUnarchive message)
        {
            var group = base.BotState.Groups.FirstOrDefault(c => c.Id == message.Channel);

            if (group == null)
            {
                return;
            }

            group.IsArchived = false;
        }
示例#3
0
 public void HandleGroupUnarchive(GroupUnarchive unarchive)
 {
     GroupLookup[unarchive.channel].is_archived = false;
 }