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(); }
protected void NotifyDomainValidations(ValidationResult validationResult) { foreach (var error in validationResult.Errors) { _notifier.Handle(new Notification(error.ErrorMessage)); } }
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()); }
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); } }
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()); }
protected void NotificateErro(string mensagem) { _logger.Error(mensagem); _notifier.Handle(new Notification(mensagem)); }
protected void Notify(string property, string message) { _notifier.Handle(new Notification(property, message)); }
protected void ReportError(string message) { _notifier.Handle(new Notification(message)); }
protected void Notificar(string mensagem) { _notifier.Handle(new Notification(mensagem)); }
protected void Notify(string message, MessageType type = MessageType.Error) { _notifier.Handle(new Notification(message, type)); }
protected void Notify(RBL.GitHub.Scrapper.Business.Validations.ValidationResult result) { result.Errors.ForEach(error => _notifier.Handle(new Notification(error))); }
public void Handle(Notification notification) { _notifier.Handle(notification); }
protected void NotifyError(string message) { _logger.LogInformation($"Notify error: {message}"); _notifier.Handle(message); }
protected void Notify(string msg) { _notifier.Handle(new Notification(msg)); }
public void Notifier(string message) { _notifier.Handle(new Notification(message)); }
protected void NotifyError(string message) => _notifier.Handle(new Notification(message));
protected void NotifyError(string errorMessage) { _notifier.Handle(new Notification(errorMessage)); }
protected void NotifyError(string mensagem) { _notifier.Handle(new Domain.Notifications.Notification(mensagem)); }
protected void AddError(string property, string error) => _notifier.Handle(new Notification(property, error));
protected void NotifierError(string mensagem) { _notifier.Handle(new NotificationMessage(mensagem)); }
/// <summary> /// Notify error /// </summary> /// <param name="validationResult"></param> protected void Notify(string message) { _notifier.Handle(message); }
private void Notify(string message) { _notifier.Handle(new Notification(message)); }
protected void Notify(string message) { _notifier.Handle(new Notification(message)); }
protected void NotifierError(string erroMessage) { _notifier.Handle(new Notificacao(erroMessage)); }