Esempio n. 1
0
 protected MockMvxViewDispatcher CreateMockNavigation()
 {
     var dispatcher = new MockMvxViewDispatcher();
     Ioc.RegisterSingleton<IMvxMainThreadDispatcher>(dispatcher);
     Ioc.RegisterSingleton<IMvxViewDispatcher>(dispatcher);
     return dispatcher;
 }
Esempio n. 2
0
 protected MockMvxViewDispatcher CreateMockNavigation()
 {
     var mockNavigation = new MockMvxViewDispatcher();
     var mockNavigationProvider = new MockMvxViewDispatcherProvider();
     mockNavigationProvider.Dispatcher = mockNavigation;
     Ioc.RegisterServiceInstance<IMvxViewDispatcherProvider>(mockNavigationProvider);
     return mockNavigation;
 }
Esempio n. 3
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);
        }