public async Task CreateTokenAsync_Creates_Token()
        {
            var provider          = new JwtTokenProvider();
            var secret            = "1234567812345678";
            var secretKey         = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(secret));
            var createTokenResult = await provider.CreateTokenAsync(null, secretKey, null, null);

            createTokenResult.Token.Should().NotBeNullOrWhiteSpace();
        }
        public Task CreateTokenAsync_When_Key_Too_Short_Throws_Exception()
        {
            var minLength   = 16;
            var tooShortKey = new String('a', minLength - 1);
            var secretKey   = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(tooShortKey));
            var provider    = new JwtTokenProvider();

            Func <Task> createToken = async() => await provider.CreateTokenAsync(null, secretKey, null, null);

            createToken.ShouldThrow <ArgumentOutOfRangeException>();

            return(Task.FromResult(0));
        }