예제 #1
0
        public void GoCausesNoNavigationForEmptySearch()
        {
            ClearAll();

            var mockNavigation = CreateMockNavigation();
            var viewModel = new HomeViewModel();
            var searchTerm = "";
            viewModel.SearchText = searchTerm;
            viewModel.SearchCommand();
            Assert.AreEqual(0, mockNavigation.NavigateRequests.Count);
        }
예제 #2
0
        public void GoCausesNavigationForNonEmptySearch()
        {
            ClearAll();

            Ioc.RegisterSingleton<IMvxStringToTypeParser>(new MvxStringToTypeParser());
            var mockNavigation = CreateMockNavigation();

            var viewModel = new HomeViewModel();
            var searchTerm = "Test Search Term";
            viewModel.SearchText = searchTerm;
            viewModel.SearchCommand();
            Assert.AreEqual(1, mockNavigation.NavigateRequests.Count);
        }