public void HasNotification_ShouldReturnFalseIfDoNotHaveNotifications() { // Arrange // Act var result = _notifier.HasNotification(); // Assert result.Should().BeFalse(); }
public async Task Insert(Customer customer) { try { await Validation(customer); if (_notifier.HasNotification()) { return; } await _context.Insert(customer); } catch (Exception ex) { _notifier.SetNotification(new Notification("Não foi possível salvar esse registro, veja o erro:" + ex.Message)); } }
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 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()); }
private bool HasNotification() { if (_notifier.HasNotification()) { return(true); } return(false); }
public async Task Save(OrderYesCustomerView orderView) { try { await Validation(orderView); if (_notifier.HasNotification()) { return; } _context.Begin(); await Save(orderView.DateCreate, orderView.Items); _context.Commit(); } catch (Exception ex) { _context.Rollback(); _notifier.SetNotification(new Notification("Não foi possível salvar esse registro, veja o erro:" + ex.Message)); } }
public async Task Save(Customer customer) { Validation(customer); if (_notifier.HasNotification()) { return; } if (customer.Operation == OperationType.Insert) { await base.Insert(customer); } else { await base.Update(customer); } }
public async Task Save(AccountModel accountModel) { Validation(accountModel); if (_notifier.HasNotification()) { return; } if (accountModel.Operation == OperationType.Insert) { await base.Insert(accountModel); } else { await base.Update(accountModel); } }
public async Task Save(AdvertisementModel advertisement) { Validation(advertisement); if (_notifier.HasNotification()) { return; } if (advertisement.Operation == OperationType.Insert) { await base.Insert(advertisement); } else { await base.Update(advertisement); } }
public async Task Save(AccountEntryModel origin, AccountEntryModel destiny) { Validation(origin, destiny); if (_notifier.HasNotification()) { return; } try { Db.Database.BeginTransaction(); await base.Insert(origin); await base.Insert(destiny); Db.Database.CommitTransaction(); } catch (Exception ex) { _notifier.SetNotification(new Notification("Não foi possível salvar esse registro:" + ex.Message)); Db.Database.RollbackTransaction(); } }
public bool ValidOperation() { return(!_notifier.HasNotification()); }
private bool OperationIsValid() { return(!_notifier.HasNotification()); }
protected bool ValidOperation() { // If not has notification(error) return true return(!_notifier.HasNotification()); }
protected bool IsValid() { return !_notifier.HasNotification(); }
public bool HasNotification() { return(_notifier.HasNotification()); }
protected bool OperacaoValida() { return(!_notifier.HasNotification()); }
protected bool ResponseValid() => !notifier.HasNotification();
protected bool ValidOperation() { return(_notifier.HasNotification() is false); }
protected bool ValidOperation() { return(!_notifier.HasNotification()); }
protected bool ValidOperation() => !_notifier.HasNotification();