예제 #1
0
 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;
 }
예제 #2
0
        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>());
        }