summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Test/OpenId
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.Test/OpenId')
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/ChannelElements/KeyValueFormEncodingTests.cs6
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/ChannelElements/OpenIdChannelTests.cs5
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/OpenIdScenarioTests.cs4
3 files changed, 6 insertions, 9 deletions
diff --git a/src/DotNetOpenAuth.Test/OpenId/ChannelElements/KeyValueFormEncodingTests.cs b/src/DotNetOpenAuth.Test/OpenId/ChannelElements/KeyValueFormEncodingTests.cs
index fff1392..7b98ac2 100644
--- a/src/DotNetOpenAuth.Test/OpenId/ChannelElements/KeyValueFormEncodingTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/ChannelElements/KeyValueFormEncodingTests.cs
@@ -35,9 +35,7 @@ namespace DotNetOpenAuth.Test.OpenId.ChannelElements {
[TestMethod]
public void BasicEncodingTest() {
- var kvf = new KeyValueFormEncoding();
-
- byte[] kvfBytes = kvf.GetBytes(this.sampleData);
+ byte[] kvfBytes = KeyValueFormEncoding.GetBytes(this.sampleData);
string responseString = Encoding.UTF8.GetString(kvfBytes);
Assert.IsFalse(responseString.Contains("\n\n"));
@@ -66,7 +64,7 @@ namespace DotNetOpenAuth.Test.OpenId.ChannelElements {
}
}
if ((mode & TestMode.Encoder) == TestMode.Encoder) {
- var e = this.keyValueForm.GetBytes(dict);
+ var e = KeyValueFormEncoding.GetBytes(dict);
Assert.IsTrue(MessagingUtilities.AreEquivalent(e, kvform), "Encoder did not produced expected result.");
}
}
diff --git a/src/DotNetOpenAuth.Test/OpenId/ChannelElements/OpenIdChannelTests.cs b/src/DotNetOpenAuth.Test/OpenId/ChannelElements/OpenIdChannelTests.cs
index ef0ec53..cd4b4b6 100644
--- a/src/DotNetOpenAuth.Test/OpenId/ChannelElements/OpenIdChannelTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/ChannelElements/OpenIdChannelTests.cs
@@ -60,7 +60,7 @@ namespace DotNetOpenAuth.Test.OpenId.ChannelElements {
public void DirectResponsesSentUsingKeyValueForm() {
IProtocolMessage message = MessagingTestBase.GetStandardTestMessage(MessagingTestBase.FieldFill.AllRequired);
MessageDictionary messageFields = new MessageDictionary(message);
- byte[] expectedBytes = new KeyValueFormEncoding().GetBytes(messageFields);
+ byte[] expectedBytes = KeyValueFormEncoding.GetBytes(messageFields);
string expectedContentType = OpenIdChannel_Accessor.KeyValueFormContentType;
Response directResponse = this.accessor.SendDirectMessageResponse(message);
@@ -79,9 +79,8 @@ namespace DotNetOpenAuth.Test.OpenId.ChannelElements {
{ "var1", "value1" },
{ "var2", "value2" },
};
- KeyValueFormEncoding kvf = new KeyValueFormEncoding();
Response response = new Response {
- ResponseStream = new MemoryStream(kvf.GetBytes(fields)),
+ ResponseStream = new MemoryStream(KeyValueFormEncoding.GetBytes(fields)),
};
Assert.IsTrue(MessagingUtilities.AreEquivalent(fields, this.accessor.ReadFromResponseInternal(response)));
}
diff --git a/src/DotNetOpenAuth.Test/OpenId/OpenIdScenarioTests.cs b/src/DotNetOpenAuth.Test/OpenId/OpenIdScenarioTests.cs
index f56f576..db0bf27 100644
--- a/src/DotNetOpenAuth.Test/OpenId/OpenIdScenarioTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/OpenIdScenarioTests.cs
@@ -26,7 +26,6 @@ namespace DotNetOpenAuth.Test.OpenId {
OpenIdCoordinator coordinator = new OpenIdCoordinator(
rp => {
rpAssociation = rp.GetAssociation(opDescription);
- Assert.IsNotNull(rpAssociation);
},
op => {
op.AutoRespond();
@@ -39,6 +38,7 @@ namespace DotNetOpenAuth.Test.OpenId {
}
};
coordinator.Run();
+ Assert.IsNotNull(rpAssociation);
Assert.AreSame(rpAssociation, coordinator.RelyingParty.AssociationStore.GetAssociation(opDescription.Endpoint, rpAssociation.Handle));
opAssociation = coordinator.Provider.AssociationStore.GetAssociation(AssociationRelyingPartyType.Smart, rpAssociation.Handle);
Assert.IsNotNull(opAssociation, "The Provider should have stored the association.");
@@ -58,7 +58,6 @@ namespace DotNetOpenAuth.Test.OpenId {
OpenIdCoordinator coordinator = new OpenIdCoordinator(
rp => {
rpAssociation = rp.GetAssociation(opDescription);
- Assert.IsNotNull(rpAssociation);
},
op => {
op.AutoRespond();
@@ -75,6 +74,7 @@ namespace DotNetOpenAuth.Test.OpenId {
unencryptedRequestSent |= message is AssociateUnencryptedRequest;
};
coordinator.Run();
+ Assert.IsNotNull(rpAssociation);
Assert.AreSame(rpAssociation, coordinator.RelyingParty.AssociationStore.GetAssociation(opDescription.Endpoint, rpAssociation.Handle));
opAssociation = coordinator.Provider.AssociationStore.GetAssociation(AssociationRelyingPartyType.Smart, rpAssociation.Handle);
Assert.IsNotNull(opAssociation, "The Provider should have stored the association.");