public void GetSigningKeys_WhenKeyResolverReturnsKey_ExpectKeyFromResolver()
        {
            var expectedKey = new RsaSecurityKey(RSA.Create());

            var handler = new TestJwtPayloadTokenHandler();
            var keys    = handler.TestGetSigningKeys("test", new TokenValidationParameters
            {
                IssuerSigningKeyResolver = (token, securityToken, kid, parameters) => new[] { expectedKey },
                IssuerSigningKey         = new RsaSecurityKey(RSA.Create())
            }).ToList();

            keys.Count.Should().Be(1);
            keys.Should().Contain(expectedKey);
        }
        public void GetSigningKeys_WheKeysInParameters_ExpectAllKeys()
        {
            var expectedKey1 = new RsaSecurityKey(RSA.Create());
            var expectedKey2 = new RsaSecurityKey(RSA.Create());

            var handler = new TestJwtPayloadTokenHandler();
            var keys    = handler.TestGetSigningKeys("test", new TokenValidationParameters
            {
                IssuerSigningKeyResolver = (token, securityToken, kid, parameters) => new List <SecurityKey>(),
                IssuerSigningKey         = expectedKey1,
                IssuerSigningKeys        = new[] { expectedKey2 }
            }).ToList();

            keys.Count.Should().Be(2);
            keys.Should().Contain(expectedKey1);
            keys.Should().Contain(expectedKey2);
        }