public async void GetRefreshTokenByUserIdWithNull() { RefreshTokenService refreshService = new RefreshTokenService(_repo); var result = await refreshService.GetRefreshTokenByUserId(null); Assert.Null(result); }
public async void GetRefreshTokenByUserIdWithWrongId() { string id = "id"; RefreshTokenService refreshService = new RefreshTokenService(_repo); var result = await refreshService.GetRefreshTokenByUserId(id); Assert.Null(result); }
public async void GetRefreshTokenByUserIdWithRightId() { string id = "id"; var token = new RefreshToken { TokenValue = "token", UserId = id }; _repo.GetRefreshTokenByUserId(id).Returns(token); RefreshTokenService refreshService = new RefreshTokenService(_repo); var result = await refreshService.GetRefreshTokenByUserId(id); Assert.NotNull(result); Assert.IsType <RefreshToken>(result); Assert.NotNull(result.TokenValue); Assert.NotNull(result.UserId); Assert.Equal(result.UserId, id); }