Exemplo n.º 1
0
        public void HandlesValidTeamRename()
        {
            var team = new TeamData { Name = "Team1" };
            var mockState = new Mock<IBotState>();
            mockState.Setup(s => s.Team).Returns(team).Verifiable();

            var message = new TeamRename
            {
                Type = EventType.TeamRename,
                Name = "Team1b"
            };

            RunHandler(message, mockState);

            Assert.Equal("Team1b", team.Name);
        }
Exemplo n.º 2
0
        public void HandlesValidEmailDomainChanged()
        {
            var team = new TeamData { EmailDomain = "team.com" };
            var mockState = new Mock<IBotState>();
            mockState.Setup(s => s.Team).Returns(team).Verifiable();

            var message = new EmailDomainChanged
            {
                Type = EventType.EmailDomainChanged,
                EmailDomain = "team2.com"
            };

            RunHandler(message, mockState);

            Assert.Equal("team2.com", team.EmailDomain);
        }
Exemplo n.º 3
0
        public void HandlesValidTeamPrefChange()
        {
            var team = new TeamData { Prefs = new JObject() };
            team.Prefs["pref1"] = false;

            var mockState = new Mock<IBotState>();
            mockState.Setup(s => s.Team).Returns(team).Verifiable();

            var message = new TeamPrefChange
            {
                Type = EventType.TeamPrefChange,
                Name = "pref1",
                Value = true
            };

            RunHandler(message, mockState);

            Assert.True((bool)team.Prefs["pref1"]);
        }