public async void HasTheAbilityToLoadRepoHistory() { var container = new RepoHistoryContainer() { Owners = new List <string> { "owner1", "owner2" }, Repositories = new List <string> { "repo1", "repo2" }, Urls = new List <string> { "https://github.com/owner/repo1/pull/122", "https://github.com/owner/repo2/pull/121" }, }; _repoHistoryPersist.Load().Returns(Task.FromResult(container)); await _mainWindowVm.LoadRepoHistory(); _repoHistoryPersist.Received(1).Load().IgnoreAsyncWarning(); CollectionAssert.AreEqual(_mainWindowVm.RecentRepoes.Owners, container.Owners); CollectionAssert.AreEqual(_mainWindowVm.RecentRepoes.Repositories, container.Repositories); CollectionAssert.AreEqual(_mainWindowVm.RecentRepoes.PullRequests.Select(r => r.ToUrl()), container.Urls); }
private async void OnLoaded(object sender, RoutedEventArgs e) { TxtPullRequest.Focus(); await _viewModel.LoadRepoHistory(); }