public async Task NaoDeviCriarAmigoPorFaltadeUsuario() { var usuario = new User("1", "*****@*****.**"); _userRepositoryMock.Setup(x => x.FindByIdAsync(It.IsAny <Guid>())); var notificationContext = new NotificationContext(); var service = new FriendApplicationService(notificationContext, _friendRepositoryMock.Object, _mapperMock.Object, _userRepositoryMock.Object , _gameRepositoryMock.Object, _loanRepositoryMock.Object); await service.CreateAsync(usuario.Id, new FriendModel { Name = "1", Email = "*****@*****.**", Phone = "3333" }); service.Valid.Should().BeFalse(); service.GetNotifications.Any(x => x.Message.Contains("Usuário não encontrado")).Should().BeTrue(); }
public async Task DeveCriarAmigo() { var usuario = new User("1", "*****@*****.**"); _userRepositoryMock.Setup(x => x.FindByIdAsync(It.IsAny <Guid>())) .Returns(Task.FromResult(usuario)); var notificationContext = new NotificationContext(); var service = new FriendApplicationService(notificationContext, _friendRepositoryMock.Object, _mapperMock.Object, _userRepositoryMock.Object , _gameRepositoryMock.Object, _loanRepositoryMock.Object); await service.CreateAsync(usuario.Id, new FriendModel { Name = "1", Email = "*****@*****.**", Phone = "3333" }); service.Valid.Should().BeTrue(); }