Exemple #1
0
        public MountainAreaViewModel(
            Location location,
            INavigator navigator,
            Func <Location, ForecastReportViewModel> forecastReportViewModelFactory)
        {
            _location  = location;
            _navigator = navigator;
            _forecastReportViewModel = forecastReportViewModelFactory(_location);

            ShowForecastCommand = new Command(ShowForecast);
        }
        public MountainAreaViewModel(
            Location location, 
            INavigator navigator,
            Func<Location, ForecastReportViewModel> forecastReportViewModelFactory)
        {
            _location = location;
            _navigator = navigator;
            _forecastReportViewModel = forecastReportViewModelFactory(_location);

            ShowForecastCommand = new Command(ShowForecast);
        }
        public void CreatesWithForecast()
        {
            var location = new Location { Id = 100, Name = "Area 1" };
            var service = new MockMountainWeatherService();
            var dialogProvder = new Mock<IDialogProvider>();

            var viewModel = new ForecastReportViewModel(location, dialogProvder.Object, service);
            viewModel.LoadForecast();


            Assert.That(viewModel.Items, Is.Not.Null);
            Assert.That(viewModel.Items.Count(), Is.EqualTo(5));
        }