public void Does_Not_Call_Notifier_When_User_Has_Not_Activated_Notification() { _userRepository.GetById(Arg.Any <int>()).ReturnsForAnyArgs(new User { HasActivatedNotification = false }); _sut.NotifyUser(1); _notifier.DidNotReceive().Notify(Arg.Any <User>()); }
public void call_Logger_when_GetByID_Exception() { InvalidUserIdException exp = new InvalidUserIdException(); var user = new User() { HasActivatedNotification = true }; _userRepository.GetById(1).Returns(x => throw exp); _notificationService.NotifyUser(1); _notifier.DidNotReceive().Notify(user); _logger.Received().Error(exp.Message); }
public void Does_Not_Call_When_User_Has_Not_Activated_Notification() { _notificationService.NotifyUser(12); _notifier.DidNotReceive().Notify(Arg.Any <User>()); _notifier.DidNotReceiveWithAnyArgs().Notify(default);
public void Does_Not_Call_Notifier_When_User_Has_Not_Activated_Notification() { _service.NotifyUser(11); _notifier.DidNotReceive().Notify(Arg.Any <User>()); }