diff options
Diffstat (limited to 'src/DotNetOpenId.Test/Extensions/AttributeExchangeTests.cs')
-rw-r--r-- | src/DotNetOpenId.Test/Extensions/AttributeExchangeTests.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/DotNetOpenId.Test/Extensions/AttributeExchangeTests.cs b/src/DotNetOpenId.Test/Extensions/AttributeExchangeTests.cs index f9c769e..7ed6699 100644 --- a/src/DotNetOpenId.Test/Extensions/AttributeExchangeTests.cs +++ b/src/DotNetOpenId.Test/Extensions/AttributeExchangeTests.cs @@ -88,5 +88,20 @@ namespace DotNetOpenId.Test.Extensions { for (int i = 0; i < newAttribute.Values.Length; i++)
Assert.AreEqual(newAttribute.Values[i], att.Values[i]);
}
+
+ /// <summary>
+ /// Tests that two extensions that use the same namespace cannot
+ /// both be added to the message at once, per the spec.
+ /// </summary>
+ [Test, ExpectedException(typeof(OpenIdException))]
+ public void FetchAndStore() {
+ var identityUrl = TestSupport.GetIdentityUrl(TestSupport.Scenarios.ExtensionFullCooperation, Version);
+ var returnTo = TestSupport.GetFullUrl(TestSupport.ConsumerPage);
+ var realm = new Realm(TestSupport.GetFullUrl(TestSupport.ConsumerPage).AbsoluteUri);
+ var consumer = new OpenIdRelyingParty(AppStore, null);
+ var request = consumer.CreateRequest(identityUrl, realm, returnTo);
+ request.AddExtension(new AttributeExchangeFetchRequest());
+ request.AddExtension(new AttributeExchangeStoreRequest());
+ }
}
}
|