Beispiel #1
0
        public async Task RevokeAsync_ShouldRevokeToken_WhenRefreshTokenExists()
        {
            var refreshToken = _fixture.Create <RefreshToken>();
            var token        = "randomTestToken";

            _refreshTokenRepository.GetAsync(token).Returns(refreshToken);

            await _sut.RevokeAsync(token);

            refreshToken.Revoked.ShouldBeTrue();
            await _refreshTokenRepository.Received(1).UpdateAsync(refreshToken);
        }