Skip to content
Browse files

Fixes two more tests. 2 left

  • Loading branch information...
1 parent 61b4d2b commit df6e154ad1cb197386cc96743eb930f010404c5c @AArnott AArnott committed
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/DotNetOpenAuth.AspNet.Test/OAuthClientTest.cs
View
10 src/DotNetOpenAuth.AspNet.Test/OAuthClientTest.cs
@@ -6,6 +6,7 @@
namespace DotNetOpenAuth.AspNet.Test {
using System;
+ using System.Collections.Specialized;
using System.Web;
using DotNetOpenAuth.AspNet;
using DotNetOpenAuth.AspNet.Clients;
@@ -34,13 +35,14 @@ public class OAuthClientTest {
[TestCase]
public async Task RequestAuthenticationInvokeMethodOnWebWorker() {
// Arrange
+ var returnUri = new Uri("http://live.com/my/path.cshtml?q=one");
var webWorker = new Mock<IOAuthWebWorker>(MockBehavior.Strict);
webWorker
- .Setup(w => w.RequestAuthenticationAsync(It.Is<Uri>(u => u.ToString().Equals("http://live.com/my/path.cshtml?q=one")), It.IsAny<CancellationToken>()))
+ .Setup(w => w.RequestAuthenticationAsync(returnUri, It.IsAny<CancellationToken>()))
+ .Returns(Task.FromResult(new Uri("http://someauth/uri")))
.Verifiable();
var client = new MockOAuthClient(webWorker.Object);
- var returnUri = new Uri("http://live.com/my/path.cshtml?q=one");
var context = new Mock<HttpContextBase>();
// Act
@@ -94,7 +96,9 @@ public class OAuthClientTest {
var request = new AuthorizedTokenRequest(endpoint, new Version("1.0"));
var webWorker = new Mock<IOAuthWebWorker>(MockBehavior.Strict);
- webWorker.Setup(w => w.ProcessUserAuthorizationAsync(It.IsAny<HttpContextBase>(), CancellationToken.None)).Returns(Task.FromResult<AccessTokenResponse>(null)).Verifiable();
+ webWorker
+ .Setup(w => w.ProcessUserAuthorizationAsync(It.IsAny<HttpContextBase>(), CancellationToken.None))
+ .Returns(Task.FromResult(new AccessTokenResponse("ok", "secret", new NameValueCollection()))).Verifiable();
var client = new MockOAuthClient(webWorker.Object);
var context = new Mock<HttpContextBase>();

0 comments on commit df6e154

Please sign in to comment.
Something went wrong with that request. Please try again.