コード例 #1
0
ファイル: MvxTest.cs プロジェクト: Dexyon/MvvmCross-Samples
 protected MockMvxViewDispatcher CreateMockNavigation()
 {
     var dispatcher = new MockMvxViewDispatcher();
     Ioc.RegisterSingleton<IMvxMainThreadDispatcher>(dispatcher);
     Ioc.RegisterSingleton<IMvxViewDispatcher>(dispatcher);
     return dispatcher;
 }
コード例 #2
0
 protected MockMvxViewDispatcher CreateMockNavigation()
 {
     var mockNavigation = new MockMvxViewDispatcher();
     var mockNavigationProvider = new MockMvxViewDispatcherProvider();
     mockNavigationProvider.Dispatcher = mockNavigation;
     Ioc.RegisterServiceInstance<IMvxViewDispatcherProvider>(mockNavigationProvider);
     return mockNavigation;
 }
コード例 #3
0
ファイル: HomeViewModelTest.cs プロジェクト: GSerjo/Seminars
        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);
        }