fixed broken convention test

This commit is contained in:
Brendan Forster
2015-01-29 13:04:30 +09:30
parent 4ad2b5ca8d
commit 5ac49efca1
3 changed files with 10 additions and 5 deletions
@@ -159,7 +159,7 @@ namespace Octokit.Tests.Clients
"secret",
Arg.Any<NewAuthorization>(),
"two-factor-code")
.Returns(Task.Factory.StartNew(() => new ApplicationAuthorization { Token = "xyz" }));
.Returns(Task.Factory.StartNew(() => new ApplicationAuthorization("xyz")));
var result = await client.GetOrCreateApplicationAuthentication("clientId",
"secret",
@@ -191,7 +191,7 @@ namespace Octokit.Tests.Clients
"secret",
Arg.Any<NewAuthorization>(),
"two-factor-code")
.Returns(Task.Factory.StartNew(() => new ApplicationAuthorization { Token = "OAUTHSECRET" }));
.Returns(Task.Factory.StartNew(() => new ApplicationAuthorization("OAUTHSECRET")));
var result = await client.GetOrCreateApplicationAuthentication("clientId",
"secret",
@@ -16,7 +16,7 @@ namespace Octokit.Tests.Reactive
{
var firstResponse = new TwoFactorRequiredException(TwoFactorType.AuthenticatorApp);
var twoFactorChallengeResult = new TwoFactorChallengeResult("two-factor-code");
var secondResponse = new ApplicationAuthorization { Token = "OAUTHSECRET" };
var secondResponse = new ApplicationAuthorization("OAUTHSECRET");
var client = Substitute.For<IObservableAuthorizationsClient>();
client.GetOrCreateApplicationAuthentication(Args.String, Args.String, Args.NewAuthorization)
@@ -51,7 +51,7 @@ namespace Octokit.Tests.Reactive
TwoFactorChallengeResult.RequestResendCode,
new TwoFactorChallengeResult("two-factor-code")
});
var secondResponse = new ApplicationAuthorization { Token = "OAUTHSECRET" };
var secondResponse = new ApplicationAuthorization("OAUTHSECRET");
var client = Substitute.For<IObservableAuthorizationsClient>();
client.GetOrCreateApplicationAuthentication(Args.String, Args.String, Args.NewAuthorization)
@@ -10,6 +10,11 @@ namespace Octokit
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class ApplicationAuthorization : Authorization
{
public ApplicationAuthorization(string token)
{
Token = token;
}
/// <summary>
/// The oauth token (be careful with these, they are like passwords!).
/// </summary>
@@ -18,6 +23,6 @@ namespace Octokit
/// the authorization is created. All subsequent API calls
/// (for example, 'get' for an authorization) will return `null`
/// </remarks>
public string Token { get; set; }
public string Token { get; private set; }
}
}