Esempio n. 1
0
        public void GenerateSendsClientNameWithChatMessage()
        {
            ChatMessage chatMsg = new ChatMessage() { ClientName = "terence", Message = "Test" };
            chatLog.Add(chatMsg);

            serverChatLogView.Generate(1f);

            stubOutgoingMessageQueue.AssertWasCalled(x => x.AddToReliableQueue(Arg<Item>.Matches(y => y.Type == ItemType.ChatLog && ((List<ChatMessage>)y.Data)[0].ClientName == "terence")));
        }
Esempio n. 2
0
        public void CopyConstructorCopiesDeep()
        {
            ChatMessage msg1 = new ChatMessage() { ClientName = "terence", Message = "foo" };
            
            ChatMessage copy = new ChatMessage(msg1);
            msg1.ClientName = "zak";
            msg1.Message = "bar";

            Assert.AreEqual("terence", copy.ClientName);
            Assert.AreEqual("foo", copy.Message);
        }
Esempio n. 3
0
 public ChatMessage(ChatMessage copySource)
 {
     ClientName = copySource.ClientName;
     Message = copySource.Message;
 }
Esempio n. 4
0
        public void TurnsToStringCorrectly()
        {
            ChatMessage chatMsg = new ChatMessage() { ClientName = "me", Message = "my message" };

            Assert.AreEqual("[me] my message", chatMsg.ToString());
        }