Exemplo n.º 1
0
        public void RoundTripFullStackTest()
        {
            IOpenIdMessageExtension request  = new MockOpenIdExtension("requestPart", "requestData");
            IOpenIdMessageExtension response = new MockOpenIdExtension("responsePart", "responseData");

            ExtensionTestUtilities.Roundtrip(
                Protocol.Default,
                new IOpenIdMessageExtension[] { request },
                new IOpenIdMessageExtension[] { response });
        }
        public async Task RoundTripFullStackTest()
        {
            IOpenIdMessageExtension request  = new MockOpenIdExtension("requestPart", "requestData");
            IOpenIdMessageExtension response = new MockOpenIdExtension("responsePart", "responseData");

            await this.RoundtripAsync(
                Protocol.Default,
                new IOpenIdMessageExtension[] { request },
                new IOpenIdMessageExtension[] { response });
        }
Exemplo n.º 3
0
        public void PrepareMessageForReceiving()
        {
            this.request.ExtraData["openid.ns.mock"]   = MockOpenIdExtension.MockTypeUri;
            this.request.ExtraData["openid.mock.Part"] = "part";
            this.request.ExtraData["openid.mock.data"] = "extra";
            Assert.IsNotNull(this.rpElement.ProcessIncomingMessage(this.request));
            MockOpenIdExtension ext = this.request.Extensions.OfType <MockOpenIdExtension>().Single();

            Assert.AreEqual("part", ext.Part);
            Assert.AreEqual("extra", ext.Data);
        }
        public async Task PrepareMessageForReceiving()
        {
            this.request.ExtraData["openid.ns.mock"]   = MockOpenIdExtension.MockTypeUri;
            this.request.ExtraData["openid.mock.Part"] = "part";
            this.request.ExtraData["openid.mock.data"] = "extra";
            Assert.IsNotNull(await this.rpElement.ProcessIncomingMessageAsync(this.request, CancellationToken.None));
            MockOpenIdExtension ext = this.request.Extensions.OfType <MockOpenIdExtension>().Single();

            Assert.AreEqual("part", ext.Part);
            Assert.AreEqual("extra", ext.Data);
        }
Exemplo n.º 5
0
        public void TwoExtensionsSameTypeUri()
        {
            IOpenIdMessageExtension request1 = new MockOpenIdExtension("requestPart1", "requestData1");
            IOpenIdMessageExtension request2 = new MockOpenIdExtension("requestPart2", "requestData2");

            try {
                ExtensionTestUtilities.Roundtrip(
                    Protocol.Default,
                    new IOpenIdMessageExtension[] { request1, request2 },
                    new IOpenIdMessageExtension[0]);
                Assert.Fail("Expected ProtocolException not thrown.");
            } catch (AssertionException ex) {
                Assert.IsInstanceOf <ProtocolException>(ex.InnerException);
            }
        }
        public async Task TwoExtensionsSameTypeUri()
        {
            IOpenIdMessageExtension request1 = new MockOpenIdExtension("requestPart1", "requestData1");
            IOpenIdMessageExtension request2 = new MockOpenIdExtension("requestPart2", "requestData2");

            try {
                await this.RoundtripAsync(
                    Protocol.Default,
                    new IOpenIdMessageExtension[] { request1, request2 },
                    new IOpenIdMessageExtension[0]);

                Assert.Fail("Expected ProtocolException not thrown.");
            } catch (ProtocolException) {
                // success
            }
        }