Пример #1
0
        public void testUpdateMessageSetComplete()
        {
            MhvDao dao = new MhvDao();

            TriageGroupsTO groups = dao.getValidRecipients("71");
            MessageTO message = dao.writeSecureMessage("133274", "", "71", Convert.ToString(groups.triageGroups[0].id),
                "Hello from the MDWS demo project!", "Message Thread Subject", "DRAFT");

            Assert.IsNotNull(message);
            Assert.IsNull(message.fault);
            Assert.IsTrue(message.id > 0, "Message ID should be set");
            Assert.IsTrue(message.threadId == 133274, "Message should be part of defined thread");
            Assert.IsFalse(message.completedDate.Year > 1, "Draft messages should not have a date set");

            MessageTO completeMessage = dao.writeSecureMessage("133274", Convert.ToString(message.id), "71",
                Convert.ToString(groups.triageGroups[0].id), "Hello from the MDWS demo project!", "Message Thread Subject", "COMPLETE");

            Assert.IsNotNull(completeMessage);
            Assert.IsNull(completeMessage.fault);
            Assert.IsTrue(completeMessage.id == message.id, "Message ID should be same");
            Assert.IsTrue(completeMessage.threadId == 133274, "Message thread should be same");
            Assert.IsTrue(completeMessage.completedDate.Year == DateTime.Now.Year, "Completed messages should have a completed date set");
        }
Пример #2
0
        public void testWriteNewCompleteMessageActiveThread()
        {
            MhvDao dao = new MhvDao();

            TriageGroupsTO groups = dao.getValidRecipients("71");
            MessageTO message = dao.writeSecureMessage("133274", "", "71", Convert.ToString(groups.triageGroups[0].id), "Hello from the MDWS demo project!", "Message Thread Subject", "COMPLETE");

            Assert.IsNotNull(message);
            Assert.IsNull(message.fault);
            Assert.IsTrue(message.id > 0, "Message ID should be set");
            Assert.IsTrue(message.threadId == 133274, "Message should be part of defined thread");
            Assert.IsTrue(String.Equals(groups.triageGroups[0].name, message.recipientName));
        }
Пример #3
0
        public void testWriteNewDraftMessageNewThread()
        {
            MhvDao dao = new MhvDao();

            TriageGroupsTO groups = dao.getValidRecipients("71");
            MessageTO message = dao.writeSecureMessage("", "", "71", Convert.ToString(groups.triageGroups[0].id), "Hello from the MDWS demo project!", "Message Thread Subject", "DRAFT");

            Assert.IsNotNull(message);
            Assert.IsNull(message.fault);
            Assert.IsTrue(message.id > 0, "Message ID should be set");
            Assert.IsTrue(message.threadId > 0, "Message should have a thread ID");
            Assert.IsFalse(message.completedDate.Year > 1, "Draft messages should not have a date set");
        }