public void ViewSeasonsCommand_HappyPath()
        {
            // Arrange
            // Instantiate class under test.
            var viewModel = new MainWindowViewModel(_windowService);

            // Act
            viewModel.ViewSeasonsCommand.Execute(null);

            // Assert
            A.CallTo(() => _windowService.GetAllSeasonIds()).MustHaveHappenedOnceExactly();

            Assert.IsInstanceOf <ReadOnlyCollection <int> >(viewModel.Seasons);
            Assert.AreEqual(1920, viewModel.SelectedSeason);
        }
Пример #2
0
        private void ViewSeasons()
        {
            try
            {
                Seasons        = new ReadOnlyCollection <int>(_windowService.GetAllSeasonIds().ToList());
                SelectedSeason = 1920;
            }
            catch (Exception ex)
            {
                _log.Error(ex.Message);

                throw;
            }
        }