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