public void JwtHeader_Defaults()
 {
     JwtHeader jwtHeader = new JwtHeader();
     Assert.IsFalse(jwtHeader.ContainsValue(JwtConstants.HeaderType), "jwtHeader.ContainsValue( JwtConstants.HeaderType )");
     Assert.IsFalse(jwtHeader.ContainsValue(JwtHeaderParameterNames.Typ), "jwtHeader.ContainsValue( JwtConstans.ReservedHeaderParameters.Type )");
     Assert.IsFalse(jwtHeader.ContainsKey(JwtHeaderParameterNames.Alg), "!jwtHeader.ContainsKey( JwtHeaderParameterNames.Algorithm )");
     Assert.IsNull(jwtHeader.Alg, "jwtHeader.SignatureAlgorithm == null");
     Assert.IsNull(jwtHeader.SigningCredentials, "jwtHeader.SigningCredentials != null");
     Assert.IsNotNull(jwtHeader.SigningKeyIdentifier, "jwtHeader.SigningKeyIdentifier == null");
     Assert.AreEqual(jwtHeader.SigningKeyIdentifier.Count, 0, "jwtHeader.SigningKeyIdentifier.Count !== 0");
     Assert.AreEqual(jwtHeader.Comparer.GetType(), StringComparer.Ordinal.GetType(), "jwtHeader.Comparer.GetType() != StringComparer.Ordinal.GetType()");
 }
示例#2
0
        public void JwtHeader_Defaults()
        {
            JwtHeader jwtHeader = new JwtHeader();

            Assert.IsFalse(jwtHeader.ContainsValue(JwtConstants.HeaderType), "jwtHeader.ContainsValue( JwtConstants.HeaderType )");
            Assert.IsFalse(jwtHeader.ContainsValue(JwtHeaderParameterNames.Typ), "jwtHeader.ContainsValue( JwtConstans.ReservedHeaderParameters.Type )");
            Assert.IsFalse(jwtHeader.ContainsKey(JwtHeaderParameterNames.Alg), "!jwtHeader.ContainsKey( JwtHeaderParameterNames.Algorithm )");
            Assert.IsNull(jwtHeader.Alg, "jwtHeader.SignatureAlgorithm == null");
            Assert.IsNull(jwtHeader.SigningCredentials, "jwtHeader.SigningCredentials != null");
            Assert.IsNotNull(jwtHeader.SigningKeyIdentifier, "jwtHeader.SigningKeyIdentifier == null");
            Assert.AreEqual(jwtHeader.SigningKeyIdentifier.Count, 0, "jwtHeader.SigningKeyIdentifier.Count !== 0");
            Assert.AreEqual(jwtHeader.Comparer.GetType(), StringComparer.Ordinal.GetType(), "jwtHeader.Comparer.GetType() != StringComparer.Ordinal.GetType()");
        }