Esempio n. 1
0
 public Task <ActionResult <List <UnifiedModuleMessageView> > > GetMessagesAsync([FromQuery] UnifiedModuleMessageViewSearch search)
 {
     return(ThrowToAction(() =>
     {
         return moduleMessageService.SearchAsync(search, GetRequesterNoFail());
     }));
 }
Esempio n. 2
0
        public void BasicAddUserMessage()
        {
            //Send a self message
            var baseMessage = GetUserMessage(unit.commonUser.id, unit.commonUser.id);
            var result      = service.AddMessageAsync(baseMessage, commonRequester).Result;
            var messages    = service.SearchAsync(new UnifiedModuleMessageViewSearch()
            {
                ReceiverIds = new List <long>()
                {
                    unit.commonUser.id
                }
            }, commonRequester).Result;

            Assert.Single(messages);
            Assert.Equal(baseMessage.message, messages.First().message);
            Assert.Equal(baseMessage.module, messages.First().module);
            Assert.Equal(result.id, messages.First().id);
        }