public void Given_TeamLeagueDoesNotExist_When_GetPlayersForTeamCompetitor_Then_TeamLeagueNotFoundException()
        {
            // Arrange
            var teams   = new TeamsBuilder().Build();
            var players = new PlayerBuilder().Build();
            var builder = new TeamLeagueBuilder()
                          .WithCompetitors(teams)
                          .WithPlayers(teams[0], players);

            var teamLeague = builder.Build();

            var contextMock = MockDbContext(
                new List <TeamLeague> {
                teamLeague
            }.AsQueryable(),
                teamLeague.Competitors.Select(c => c.Team).AsQueryable()
                );
            var handler = new GetPlayersForTeamCompetitorQueryHandler(
                contextMock.Object,
                Mapper.MapperConfig()
                );

            //Act
            var command = new GetPlayersForTeamCompetitorQuery
            {
                LeagueName = "DoesNotExist",
                TeamName   = "Tottenham Hotspur"
            };
            Func <Task> func = async() => await handler.Handle(command, CancellationToken.None);

            //Assert
            func.Should().Throw <TeamLeagueNotFoundException>();
        }
        public async void Given_TeamHasPlayers_When_GetPlayersForTeamCompetitor_Then_Success()
        {
            // Arrange
            var teams   = new TeamsBuilder().Build();
            var players = new PlayerBuilder().Build();
            var builder = new TeamLeagueBuilder()
                          .WithCompetitors(teams)
                          .WithPlayers(teams[0], players);

            var teamLeague = builder.Build();

            var contextMock = MockDbContext(
                new List <TeamLeague> {
                teamLeague
            }.AsQueryable(),
                teamLeague.Competitors.Select(c => c.Team).AsQueryable()
                );
            var handler = new GetPlayersForTeamCompetitorQueryHandler(
                contextMock.Object,
                Mapper.MapperConfig()
                );

            //Act
            var command = new GetPlayersForTeamCompetitorQuery
            {
                LeagueName = "Premier League",
                TeamName   = "Tottenham Hotspur"
            };
            var result = await handler.Handle(command, CancellationToken.None);

            //Assert
            result.Should().BeOfType <List <CompetitorPlayerDto> >();
            result.ToList().Count.Should().Be(2);
        }