public void ApplicationTest_SendMessage()
 {
     IMessageService messageService = new MessageServiceImpl(new EntityFrameworkRepositoryContext(),
             new MessageRepository(new EntityFrameworkRepositoryContext()),
             new ContactRepository(),
             new SendSiteMessageService());
     Assert.True(messageService.SendMessage("title", "content", "xiaocai", "大神").IsSuccess);
 }
 public void MessageApplication()
 {
     IMessageService messageService = new MessageServiceImpl(new MessageDomainService(
             new MessageRepository(new EntityFrameworkRepositoryContext()),
             new UserRepository(new EntityFrameworkRepositoryContext())));
     UserDTO userDTO = new UserDTO
     {
         Name = "小菜"
     };
     var messages = messageService.GetMessagesBySendUser(userDTO);
     foreach (MessageDTO item in messages)
     {
         Console.WriteLine(item.Title);
     }
 }
 public void ApplicationTest_ReadInbox()
 {
     IMessageService messageService = new MessageServiceImpl(new EntityFrameworkRepositoryContext(),
             new MessageRepository(new EntityFrameworkRepositoryContext()),
             new ContactRepository(),
             new SendSiteMessageService());
     foreach (MessageDTO message in messageService.ReadInbox("dashen").Data)
     {
         Console.WriteLine("ID:" + message.ID);
         Console.WriteLine("Title:" + message.Title);
         Console.WriteLine("Content:" + message.Content);
         Console.WriteLine("Sender:" + message.Sender.DisplayName);
         Console.WriteLine("Recipient:" + message.Recipient.DisplayName);
         Console.WriteLine("MessageState:" + message.State);
     }
 }