public void ViewTeamsCommand_HappyPath()
        {
            // Arrange
            // Instantiate class under test.
            var viewModel = new TeamSeasonsControlViewModel(_sharedService, _controlService);

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

            // Assert
            A.CallTo(() => _controlService.GetEntities((int)WpfGlobals.SelectedSeason))
            .MustHaveHappenedOnceExactly();

            Assert.IsInstanceOf <ReadOnlyCollection <TeamSeason> >(viewModel.Teams);
        }
Exemplo n.º 2
0
        private void ViewTeams()
        {
            try
            {
                Teams = new ReadOnlyCollection <TeamSeason>(
                    _controlService.GetEntities((int)WpfGlobals.SelectedSeason).ToList());
            }
            catch (Exception ex)
            {
                _log.Error(ex.Message);

                throw;
            }
        }