public void SetUp()
        {
            _service = new Mock <IGetNotificationsService>();
            _sut     = new GetNotificationsQueryHandler(_service.Object);

            _query = new GetNotificationsQuery();
        }
Ejemplo n.º 2
0
 public NotificationsController(GetNewNotificationsQuery getNewNotificationsQuery, CheckForNewNotificationsQuery checkForNewNotificationsQuery, CreateNotificationCommand createNotificationCommand, MarkNotificationAsSeenCommand markNotificationAsSeenCommand, GetNotificationsQuery getNotificationsQuery, TaskExecutor.TaskExecutor taskExecutor)
 {
     this.getNotificationsQuery         = getNotificationsQuery;
     this.getNewNotificationsQuery      = getNewNotificationsQuery;
     this.createNotificationCommand     = createNotificationCommand;
     this.markNotificationAsSeenCommand = markNotificationAsSeenCommand;
     this.checkForNewNotificationsQuery = checkForNewNotificationsQuery;
     this.taskExecutor = taskExecutor;
 }
 public async Task<IActionResult> Get(string include)
 {
     if(include == "logs")
     {
         var result = new GetNotificationsWLogsQuery();
         return Ok(await _mediatr.Send(result));
     }
     else
     {
         var result = new GetNotificationsQuery();
         return Ok(await _mediatr.Send(result));
     }
 }
Ejemplo n.º 4
0
        public async Task <ActionResult> Get(string include)
        {
            if (include == "logs")
            {
                var notif = new GetAllQuery();
                return(Ok(await _mediatr.Send(notif)));
            }
            else
            {
                var notif = new GetNotificationsQuery();

                return(Ok(await _mediatr.Send(notif)));
            }
        }
Ejemplo n.º 5
0
        public async Task <Result <List <Notification> > > Handle(GetNotificationsQuery request, CancellationToken cancellationToken)
        {
            var list = await _dbContext.Notifications.ToListAsync();

            return(Result.Ok(list));
        }
 public async Task<ActionResult<PagenatedList<NotificationViewModel>>> Get(
     [FromQuery] GetNotificationsQuery query)
 {
     return Ok(await _mediator.Send(query));
 }
        public Task <IEnumerable <EmailFrom> > Handle(GetNotificationsQuery request, CancellationToken cancellationToken)
        {
            var result = notificationRepository.GetNotifications(request.Address);

            return(Task.FromResult(result));
        }