summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Test/OpenId/ChannelElements/ExtensionsBindingElementTests.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.Test/OpenId/ChannelElements/ExtensionsBindingElementTests.cs')
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/ChannelElements/ExtensionsBindingElementTests.cs28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/DotNetOpenAuth.Test/OpenId/ChannelElements/ExtensionsBindingElementTests.cs b/src/DotNetOpenAuth.Test/OpenId/ChannelElements/ExtensionsBindingElementTests.cs
index 29797dc..5edd51f 100644
--- a/src/DotNetOpenAuth.Test/OpenId/ChannelElements/ExtensionsBindingElementTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/ChannelElements/ExtensionsBindingElementTests.cs
@@ -18,15 +18,15 @@ namespace DotNetOpenAuth.Test.OpenId.ChannelElements {
using DotNetOpenAuth.OpenId.RelyingParty;
using DotNetOpenAuth.Test.Mocks;
using DotNetOpenAuth.Test.OpenId.Extensions;
- using Microsoft.VisualStudio.TestTools.UnitTesting;
+ using NUnit.Framework;
- [TestClass]
+ [TestFixture]
public class ExtensionsBindingElementTests : OpenIdTestBase {
private StandardOpenIdExtensionFactory factory;
private ExtensionsBindingElement rpElement;
private IProtocolMessageWithExtensions request;
- [TestInitialize]
+ [SetUp]
public override void SetUp() {
base.SetUp();
@@ -37,7 +37,7 @@ namespace DotNetOpenAuth.Test.OpenId.ChannelElements {
this.request = new SignedResponseRequest(Protocol.Default.Version, OpenIdTestBase.OPUri, AuthenticationRequestMode.Immediate);
}
- [TestMethod]
+ [TestCase]
public void RoundTripFullStackTest() {
IOpenIdMessageExtension request = new MockOpenIdExtension("requestPart", "requestData");
IOpenIdMessageExtension response = new MockOpenIdExtension("responsePart", "responseData");
@@ -47,12 +47,12 @@ namespace DotNetOpenAuth.Test.OpenId.ChannelElements {
new IOpenIdMessageExtension[] { response });
}
- [TestMethod]
+ [TestCase]
public void ExtensionFactory() {
Assert.AreSame(this.factory, this.rpElement.ExtensionFactory);
}
- [TestMethod, ExpectedException(typeof(ArgumentNullException))]
+ [TestCase, ExpectedException(typeof(ArgumentNullException))]
public void PrepareMessageForSendingNull() {
this.rpElement.ProcessOutgoingMessage(null);
}
@@ -60,13 +60,13 @@ namespace DotNetOpenAuth.Test.OpenId.ChannelElements {
/// <summary>
/// Verifies that false is returned when a non-extendable message is sent.
/// </summary>
- [TestMethod]
+ [TestCase]
public void PrepareMessageForSendingNonExtendableMessage() {
IProtocolMessage request = new AssociateDiffieHellmanRequest(Protocol.Default.Version, OpenIdTestBase.OPUri);
Assert.IsNull(this.rpElement.ProcessOutgoingMessage(request));
}
- [TestMethod]
+ [TestCase]
public void PrepareMessageForSending() {
this.request.Extensions.Add(new MockOpenIdExtension("part", "extra"));
Assert.IsNotNull(this.rpElement.ProcessOutgoingMessage(this.request));
@@ -77,7 +77,7 @@ namespace DotNetOpenAuth.Test.OpenId.ChannelElements {
Assert.AreEqual("extra", this.request.ExtraData["openid." + alias + ".data"]);
}
- [TestMethod]
+ [TestCase]
public void PrepareMessageForReceiving() {
this.request.ExtraData["openid.ns.mock"] = MockOpenIdExtension.MockTypeUri;
this.request.ExtraData["openid.mock.Part"] = "part";
@@ -91,7 +91,7 @@ namespace DotNetOpenAuth.Test.OpenId.ChannelElements {
/// <summary>
/// Verifies that extension responses are included in the OP's signature.
/// </summary>
- [TestMethod]
+ [TestCase]
public void ExtensionResponsesAreSigned() {
Protocol protocol = Protocol.Default;
var op = this.CreateProvider();
@@ -113,7 +113,7 @@ namespace DotNetOpenAuth.Test.OpenId.ChannelElements {
/// <summary>
/// Verifies that unsigned extension responses (where any or all fields are unsigned) are ignored.
/// </summary>
- [TestMethod]
+ [TestCase]
public void ExtensionsAreIdentifiedAsSignedOrUnsigned() {
Protocol protocol = Protocol.Default;
OpenIdCoordinator coordinator = new OpenIdCoordinator(
@@ -144,7 +144,7 @@ namespace DotNetOpenAuth.Test.OpenId.ChannelElements {
/// OpenID Authentication 2.0 section 12 states that
/// "A namespace MUST NOT be assigned more than one alias in the same message".
/// </remarks>
- [TestMethod]
+ [TestCase]
public void TwoExtensionsSameTypeUri() {
IOpenIdMessageExtension request1 = new MockOpenIdExtension("requestPart1", "requestData1");
IOpenIdMessageExtension request2 = new MockOpenIdExtension("requestPart2", "requestData2");
@@ -154,8 +154,8 @@ namespace DotNetOpenAuth.Test.OpenId.ChannelElements {
new IOpenIdMessageExtension[] { request1, request2 },
new IOpenIdMessageExtension[0]);
Assert.Fail("Expected ProtocolException not thrown.");
- } catch (AssertFailedException ex) {
- Assert.IsInstanceOfType(ex.InnerException, typeof(ProtocolException));
+ } catch (AssertionException ex) {
+ Assert.IsInstanceOf<ProtocolException>(ex.InnerException);
}
}