예제 #1
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            var query = e.Parameter as SearchQuery;

            ViewModel = DIHelper.Resolve <SearchResultViewModel>();
            ViewModel.Initialize(query);
        }
        public void Initialize_OnNavigation_GetsIssues()
        {
            //Arrange
            var issues = new ObservableCollection <Issue> {
                new Issue {
                    ProxyKey = "ALM-100"
                }
            };

            jiraServiceMock.Setup(x => x.Search(It.IsAny <string>(), It.IsAny <bool>(), It.IsAny <bool>(), It.IsAny <bool>(), It.IsAny <CancellationTokenSource>())).Returns(Task.FromResult(issues));
            navigationServiceMock.Setup(x => x.GetNavigationParameter()).Returns(new SearchParameter {
                SearchText = "Jirabox", IsFavourite = false
            });

            //Act
            searchResultViewModel.Initialize();

            //Assert
            Assert.IsNotNull(searchResultViewModel.Issues);
        }