public HomeController(IIndexPageViewModel indexPageViewModel, IStationFinder stationFinder, IStationFinderResultPageViewModel stationFinderResultPageViewModel, IJourneyfinder journeyFinder, IJourneyDetailsPageViewModel journeyDetailsPageViewModel, IPreviousJourneysViewModel previousJourneys) { _indexPageViewModel = indexPageViewModel; _journeyFinder = journeyFinder; _stationFinder = stationFinder; _stationFinderResultPageViewModel = stationFinderResultPageViewModel; _journeyDetailsPageViewModel = journeyDetailsPageViewModel; _previousJourneys = previousJourneys; }
public void ShouldReturnViewResultFromIndexMethod() { _mockIndexViewPageModel = new Mock <IIndexPageViewModel>().Object; _mockStationFinder = new Mock <IStationFinder>().Object; _mockStationFinderResultPageModel = new Mock <IStationFinderResultPageViewModel>().Object; _mockJourneyFinder = new Mock <IJourneyfinder>().Object; _mockJourneyDetailsPageViewModel = new Mock <IJourneyDetailsPageViewModel>().Object; _mockPreviousJourneyViewModel = new Mock <IPreviousJourneysViewModel>().Object; var sut = new HomeController( _mockIndexViewPageModel, _mockStationFinder, _mockStationFinderResultPageModel, _mockJourneyFinder, _mockJourneyDetailsPageViewModel, _mockPreviousJourneyViewModel); var result = sut.Index(); Assert.That(result, Is.TypeOf <ViewResult>()); }