コード例 #1
0
        public RepositoryViewModel(string owner, string name) : base(owner, name)
        {
            _owner = owner;
            _name = name;

            IssuesViewModel = new RepositoryIssuesViewModel(_owner, _name);
            PullRequestsViewModel = new RepositoryPullRequestsViewModel(_owner, _name);
            CommitsViewModel = new RepositoryCommitsViewModel(_owner,_name);

            this.TryGetReadme();
            this.Refresh();
        }
コード例 #2
0
ファイル: RepoTests.cs プロジェクト: CuiXiaoDao/MyGit
 public async void TestRepoIssuesVM()
 {
     var vm = new RepositoryIssuesViewModel(Owner, Repo);
     GitHubClientMock.Setup(m => m.Issue.GetAllForRepository(Owner, Repo))
         .Returns(() => Task.FromResult(new List<Issue> {new Issue()} as IReadOnlyList<Issue>));
     await vm.Refresh();
     Assert.AreEqual(1, vm.Issues.Count());
     GitHubClientMock.Verify(m => m.Issue.GetAllForRepository(Owner, Repo));
 }