public void Handle_ShouldAddANotification()
        {
            // Arrange
            var notification  = _notificationFixture.GetNotification();
            var notifications = _notifier.GetNotifications();

            // Act
            _notifier.Handle(notification);
            var result = notifications.Any(n => n.Equals(notification));

            // Assert
            result.Should().BeTrue();
        }
예제 #2
0
 protected void NotifyDomainValidations(ValidationResult validationResult)
 {
     foreach (var error in validationResult.Errors)
     {
         _notifier.Handle(new Notification(error.ErrorMessage));
     }
 }
예제 #3
0
        public void Update_User_Not_Found()
        {
            User user = null;

            mockRepository.FindById(Arg.Any <string>()).Returns(user);

            var notification = new Notification("");

            mockNotifier.Handle(notification);
            var erros = mockNotifier.GetNotifications();

            mockNotifier.HasNotification().Returns(true);

            appService.Update("60259848d73bfsss5", Title, FirstName, LastName);

            Assert.True(mockNotifier.HasNotification());
        }
예제 #4
0
 public async Task <bool> Commit()
 {
     try
     {
         return(await _context.SaveChangesAsync() > 0);
     }
     catch (Exception ex)
     {
         _notifier.Handle(new Notification(string.Format("Sorry, we couldn't perform the action. {0}", ex.Message)));
         return(false);
     }
 }
예제 #5
0
        public void Get_User_Not_Found()
        {
            User user = null;

            mockRepository.FindOneAsync(Arg.Any <Expression <Func <User, bool> > >()).Returns(user);

            var notification = new Notification("");

            mockNotifier.Handle(notification);
            var erros = mockNotifier.GetNotifications();

            mockNotifier.HasNotification().Returns(true);

            appService.GetByEmail(Email_Invalido);

            Assert.True(mockNotifier.HasNotification());
        }
예제 #6
0
 protected void NotificateErro(string mensagem)
 {
     _logger.Error(mensagem);
     _notifier.Handle(new Notification(mensagem));
 }
예제 #7
0
 protected void Notify(string property, string message)
 {
     _notifier.Handle(new Notification(property, message));
 }
예제 #8
0
 protected void ReportError(string message)
 {
     _notifier.Handle(new Notification(message));
 }
예제 #9
0
 protected void Notificar(string mensagem)
 {
     _notifier.Handle(new Notification(mensagem));
 }
예제 #10
0
 protected void Notify(string message, MessageType type = MessageType.Error)
 {
     _notifier.Handle(new Notification(message, type));
 }
예제 #11
0
 protected void Notify(RBL.GitHub.Scrapper.Business.Validations.ValidationResult result)
 {
     result.Errors.ForEach(error => _notifier.Handle(new Notification(error)));
 }
예제 #12
0
 public void Handle(Notification notification)
 {
     _notifier.Handle(notification);
 }
예제 #13
0
 protected void NotifyError(string message)
 {
     _logger.LogInformation($"Notify error: {message}");
     _notifier.Handle(message);
 }
예제 #14
0
 protected void Notify(string msg)
 {
     _notifier.Handle(new Notification(msg));
 }
예제 #15
0
 public void Notifier(string message)
 {
     _notifier.Handle(new Notification(message));
 }
예제 #16
0
 protected void NotifyError(string message) => _notifier.Handle(new Notification(message));
예제 #17
0
 protected void NotifyError(string errorMessage)
 {
     _notifier.Handle(new Notification(errorMessage));
 }
예제 #18
0
 protected void NotifyError(string mensagem)
 {
     _notifier.Handle(new Domain.Notifications.Notification(mensagem));
 }
예제 #19
0
 protected void AddError(string property, string error) => _notifier.Handle(new Notification(property, error));
예제 #20
0
 protected void NotifierError(string mensagem)
 {
     _notifier.Handle(new NotificationMessage(mensagem));
 }
예제 #21
0
 /// <summary>
 /// Notify error
 /// </summary>
 /// <param name="validationResult"></param>
 protected void Notify(string message)
 {
     _notifier.Handle(message);
 }
예제 #22
0
 private void Notify(string message)
 {
     _notifier.Handle(new Notification(message));
 }
 protected void Notify(string message)
 {
     _notifier.Handle(new Notification(message));
 }
예제 #24
0
 protected void NotifierError(string erroMessage)
 {
     _notifier.Handle(new Notificacao(erroMessage));
 }