public CreateIssueViewModel(GitHubApi githubApi, IGitHubSettings settings) { this.githubApi = githubApi; this.settings = settings; Repositories = new ObservableCollection<RepositoryModel>(); CreateIssueCommand = new DelegateCommand(CreateIssue); }
public SettingsViewModel(GitHubApi githubApi, IGitHubSettings settings) { this.githubApi = githubApi; this.settings = settings; LoginCommand = new DelegateCommand<PasswordBox>(Login, p => !LoggingIn); CancelCommand = new DelegateCommand(() => OnClose()); ClearLoginDetailsCommand = new DelegateCommand(ClearLoginDetails); }
public void CustomContext() { var context = new GitHubApiContext(); var api = new GitHubApi(context); api.Context.Should().BeSameAs(context); }
async public static Task Auth(string accountName, GitHubApi api, IEnumerable<Scopes> scopes = null, string note = null) { var account = Load(accountName); var auth = account.Authorizations.FirstOrDefault(x => x.Scopes.Matches(scopes)); if (auth == null) { auth = await api.Authorize(account.Credential, scopes, note); auth.Invalidated += account.OnAuthorizationInvalidated; account.Authorizations.Add(auth); account.Save(); } else { api.Context.Authorize(auth); auth.Invalidated += account.OnAuthorizationInvalidated; } }
public SettingsViewModel(GitHubApi githubApi) { this.githubApi = githubApi; LoginCommand = new DelegateCommand<PasswordBox>(Login, p=>!LoggingIn); ClearLoginDetailsCommand = new DelegateCommand(ClearLoginDetails); }
//[SetUp] public void CreateGitHubApi() { Api = GitHubApi.Create(); }
public void CreateGitHubApi() { Api = new GitHubApi(); }
public void DefaultContext() { var api = new GitHubApi(); api.Context.Should().BeOfType<GitHubApiContext>(); }