protected MockMvxViewDispatcher CreateMockNavigation()
 {
     var mockNavigation = new MockMvxViewDispatcher();
     var mockNavigationProvider = new MockMvxViewDispatcherProvider();
     mockNavigationProvider.Dispatcher = mockNavigation;
     Ioc.RegisterServiceInstance<IMvxViewDispatcherProvider>(mockNavigationProvider);
     return mockNavigation;
 }
Beispiel #2
0
        public void GoCausesNavigationForNonEmptySearch()
        {
            var mockNavigation = new MockMvxViewDispatcher();
            var mockNavigationProvider = new MockMvxViewDispatcherProvider();
            mockNavigationProvider.Dispatcher = mockNavigation;
            Ioc.RegisterServiceInstance<IMvxViewDispatcherProvider>(mockNavigationProvider);

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