Unit testing with INavigationService

Topics: Framework Services, Getting Started
Oct 5, 2013 at 6:26 PM
Edited Oct 5, 2013 at 6:27 PM
Hello,

I'm trying to unit test a view model like the one below:
    public class StartPageViewModel : Screen
    {
        private readonly INavigationService _navigationService;

        public StartPageViewModel(
            INavigationService navigationService)
        {
            _navigationService = navigationService;
        }

        public void GotoViewModel1()
        {
            _navigationService.UriFor<ViewModel1>().Navigate();
        }
    }
[TestMethod]
        public void NewDatabaseShouldNavigateToNewDatabaseViewModel()
        {
            MockNavigationService navService = new MockNavigationService();
            StartPageViewModel fixture = new StartPageViewModel(navService);
            fixture.GotoViewModel1();
        }  
However since UriFor is an extension method, it tries to resolve the view for that view model and throws an Exception. What would be the best way to go about testing this? Thanks!

Jimmy