public async Task Should_GetUserAsync_ResturnsALoginUserModelById() { //Arrange const int userId = 1; const string password = "******"; const string email = "*****@*****.**"; var userEntity = new UserEf { Id = userId, Email = email, Password = password }; var userModel = new UserLogin { Id = userId, Email = email }; _repositoryMock.Setup(x => x.GetUserAsync(userId)) .ReturnsAsync(userEntity); _mapperMock.Setup(x => x.Map <UserLogin>(userEntity)) .Returns(userModel); _manager = new UserLoginManager(_mapperMock.Object, _repositoryMock.Object); //Act var model = await _manager.GetUserAsync(userId); //Assert _repositoryMock.Verify(x => x.GetUserAsync(userId), Times.Once); _mapperMock.Verify(x => x.Map <UserLogin>(userEntity), Times.Once); Assert.NotNull(model.Email); Assert.Equal(userId, model.Id); Assert.Equal(email, model.Email); }