Example #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();
        }
Example #2
0
 public async void TestRepoPRViewModel()
 {
     var vm = new RepositoryPullRequestsViewModel(Owner, Repo);
     GitHubClientMock.Setup(m => m.PullRequest.GetAllForRepository(Owner, Repo)).Returns(() => Task.FromResult(new List<PullRequest> { new PullRequest()} as IReadOnlyList<PullRequest>));
     await vm.Refresh();
     Assert.AreEqual(1, vm.PullRequests.Count());
     GitHubClientMock.Verify(m => m.PullRequest.GetAllForRepository(Owner, Repo), Times.Once());
 }