コード例 #1
0
        void Listener_OnMessagePublished(Fizz.Chat.FizzChannelMessage msg)
        {
            if (channelLoopup.ContainsKey(msg.To))
            {
                channelLoopup[msg.To].AddMessage(msg);
            }

            if (OnChannelMessage != null)
            {
                OnChannelMessage.Invoke(msg.To, msg);
            }
        }
コード例 #2
0
        public void IntegrityTest()
        {
            var now = FizzUtils.Now();
            var m   = new FizzChannelMessage(
                1,
                "from",
                "nick",
                "to",
                "body",
                "data",
                null,
                now
                );

            Assert.AreEqual(m.Id, 1);
            Assert.AreEqual(m.From, "from");
            Assert.AreEqual(m.Nick, "nick");
            Assert.AreEqual(m.To, "to");
            Assert.AreEqual(m.Body, "body");
            Assert.AreEqual(m.Data, "data");
            Assert.AreEqual(m.Created, now);
        }