示例#1
0
        protected Identifier GetMockDualIdentifier()
        {
            Protocol protocol    = Protocol.Default;
            var      opDesc      = new ProviderEndpointDescription(OPUri, protocol.Version);
            var      dualResults = new IdentifierDiscoveryResult[] {
                IdentifierDiscoveryResult.CreateForClaimedIdentifier(VanityUri.AbsoluteUri, OPLocalIdentifiers[0], opDesc, 10, 10),
                IdentifierDiscoveryResult.CreateForProviderIdentifier(protocol.ClaimedIdentifierForOPIdentifier, opDesc, 20, 20),
            };

            this.RegisterMockXrdsResponse(VanityUri, dualResults);
            return(VanityUri);
        }
示例#2
0
        public void IsExtensionSupported()
        {
            var se = IdentifierDiscoveryResult.CreateForProviderIdentifier(OPUri, new ProviderEndpointDescription(OPUri, this.v20TypeUris), null, null);

            Assert.IsFalse(se.IsExtensionSupported <ClaimsRequest>());
            Assert.IsFalse(se.IsExtensionSupported(new ClaimsRequest()));
            Assert.IsFalse(se.IsTypeUriPresent("http://someextension/typeuri"));

            se = IdentifierDiscoveryResult.CreateForProviderIdentifier(
                OPUri,
                new ProviderEndpointDescription(OPUri, new[] { Protocol.V20.ClaimedIdentifierServiceTypeURI, "http://someextension", Constants.sreg_ns }),
                null,
                null);
            Assert.IsTrue(se.IsExtensionSupported <ClaimsRequest>());
            Assert.IsTrue(se.IsExtensionSupported(new ClaimsRequest()));
            Assert.IsTrue(se.IsTypeUriPresent("http://someextension"));
        }
示例#3
0
        public void IsExtensionSupportedNullExtension()
        {
            var se = IdentifierDiscoveryResult.CreateForProviderIdentifier(OPUri, new ProviderEndpointDescription(OPUri, this.v20TypeUris), null, null);

            se.IsExtensionSupported((IOpenIdMessageExtension)null);
        }
示例#4
0
        public void IsTypeUriPresentEmptyString()
        {
            var se = IdentifierDiscoveryResult.CreateForProviderIdentifier(OPUri, new ProviderEndpointDescription(OPUri, this.v20TypeUris), null, null);

            se.IsTypeUriPresent(string.Empty);
        }