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); }
private void ViewTeams() { try { Teams = new ReadOnlyCollection <TeamSeason>( _controlService.GetEntities((int)WpfGlobals.SelectedSeason).ToList()); } catch (Exception ex) { _log.Error(ex.Message); throw; } }