public void ForOtherClaimIdentifier_ThenNullReturned() { var handler = new GetUserByClaimId(_userRepo.Object); var retrievedUser = handler.Execute("1"); Assert.Null(retrievedUser); }
public void ThenUserReturned() { var user = new User { UserId = 1, DisplayName = "a friendly name" }; _userRepo .Setup(ur => ur.GetByAuthenticatedId("1")) .Returns(new User { UserId = 1, DisplayName = "a friendly name" }); var handler = new GetUserByClaimId(_userRepo.Object); var retrievedUser = handler.Execute("1"); Assert.NotNull(retrievedUser); Assert.Equal(user.UserId, retrievedUser.UserId); }