Esempio n. 1
0
        public void Should_AddNewNotification_Valid()
        {
            var notificationEvent = new NotificationEvent
            {
                Description = "Description",
                ProfileId   = "awesome",
                Status      = "approved",
                TimeStamp   = DateTime.Now,
                Title       = "Title",
                Id          = Guid.NewGuid(),
                Version     = 0
            };
            var newNotification = _manager.AddNewNotification(notificationEvent);

            Assert.NotNull(newNotification);
        }
Esempio n. 2
0
        // TODO: Does ? change the signature?
        public Task?Consume(ConsumeContext <NotificationEvent> context)
        {
            _logger.LogDebug($"Received new NotificationEvent for {context.Message.Id}");
            var notificationDto = _notificationsManager.AddNewNotification(context.Message);

            if (notificationDto != null)
            {
                return(Task.CompletedTask);
            }
            return(null);
        }