mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-05 03:30:34 +00:00
fixed broken convention test
This commit is contained in:
@@ -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; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user