public void DomainTest_ForwardMessage()
 {
     ISendMessageService sendMessageService = new SendSiteMessageService();
     Message readMessage = new Message("title", "content ", new Sender("sender"), new Recipient("recipient"));
     Contact recipient = new Sender("recipient");
     Message relayMessage = new Message("title", "content ", readMessage.Recipient, recipient);
     Assert.True(sendMessageService.SendMessage(relayMessage));
 }
 public void DomainTest_ReadOutbox()
 {
     Contact sender = new Sender("sender");
     var messages = new List<Message>() { new Message("title", "content", sender, new Recipient("recipient")) }.Where(m => m.Sender == sender);
     foreach (Message message in messages)
     {
         Console.WriteLine("ID:" + message.ID);
         Console.WriteLine("Title:" + message.Title);
         Console.WriteLine("Content:" + message.Content);
         Console.WriteLine("Sender:" + message.Sender.Name);
         Console.WriteLine("Recipient:" + message.Recipient.Name);
         Console.WriteLine("MessageState:" + (message.State == MessageState.Unread ? "未读" : "已读"));
     }
 }
 public void DomainTest_SendShortMessage()
 {
     ISendMessageService sendMessageService = new SendSiteMessageService();
     Contact sender = new Sender("sender");
     Contact recipient = new Recipient("recipient");
     Message message = new Message("title", "content ", sender, recipient);
     Assert.True(sendMessageService.SendMessage(message));
 }
 public void DomainTest_ReadMessageSender()
 {
     Contact sender = new Sender("sender");
     Message message = new Message("title", "content", sender, new Recipient("recipient"));
     Console.WriteLine("ID:" + message.ID);
     Console.WriteLine("Title:" + message.Title);
     Console.WriteLine("Content:" + message.Content);
     Console.WriteLine("Sender:" + message.Sender.Name);
     Console.WriteLine("Recipient:" + message.Recipient.Name);
     Console.WriteLine("MessageState:" + (message.State == MessageState.Unread ? "未读" : "已读"));
 }