public void TestUpdateMessage()
        {
            HomePage screen = new HomePage();
            screen.UserDetails = userDetails;
            messageSpecs.FriendStatusMessage y = new FriendStatusMessage();
            y.sender = "0000000002";
            y.UserStatus = FriendStatusMessage.LoggedOnStatus.Online;
            screen.updateContacts(y.getMessageString());

            messageSpecs.TextMessage tm = new TextMessage();
            tm.sender = "0000000001";
            tm.receiver = "0000000002";
            tm.TextToSend = "ABCD";
            screen.updateMessages(tm.getMessageString());

            object isChatpresent = screen.openChatWindows.ContainsKey(long.Parse(tm.receiver));
            Assert.AreEqual(true, isChatpresent);

            object chatWindow = screen.openChatWindows[long.Parse(tm.receiver)];
            string messageString = ((MessageANiner.UserControls.MessageHolder)(((((MessageANiner.UserControls.ChatWindow)(chatWindow)).chatMessageArea.Controls[0])))).richTextBoxContent.Text;
            Assert.AreEqual("0000000001 : ABCD", messageString);
            this.releaseResources(screen);
        }
        public void TestUpdateMessageCount()
        {
            HomePage screen = new HomePage();
            screen.UserDetails = userDetails;
            messageSpecs.FriendStatusMessage y = new FriendStatusMessage();
            y.sender = "0000000002";
            y.UserStatus = FriendStatusMessage.LoggedOnStatus.Offline;
            screen.updateContacts(y.getMessageString());

            messageSpecs.TextMessage tm = new TextMessage();
            tm.sender = "0000000001";
            tm.receiver = "0000000002";
            tm.TextToSend = "ABCD";
            screen.openedChatWindowUID = 0000224;

            screen.openedChatWindowUID = 0000224;
            screen.updateMessages(tm.getMessageString());

            object c = screen.ContactsList.Controls[0];
            int msgCount = ((MessageANiner.UserControls.ContactControl)(c)).msgCount;
            Assert.AreEqual(1, msgCount);

            screen.openedChatWindowUID = 0000224;
            tm.TextToSend = "PQRS";
            screen.updateMessages(tm.getMessageString());

            c = screen.ContactsList.Controls[0];
            msgCount = ((MessageANiner.UserControls.ContactControl)(c)).msgCount;
            Assert.AreEqual(2, msgCount);
            this.releaseResources(screen);
        }