public async Task Handle_GivenNullRequest_ShouldThrowArgumentNullException()
        {
            // Arrange
            var sut = new GetPlayWeeksForTournamentTableQueryHandler(
                It.IsAny <IDeletableEntityRepository <PlayWeek> >(),
                It.IsAny <IDeletableEntityRepository <TournamentTable> >(),
                It.IsAny <IMapper>());

            // Act & Assert
            await Should.ThrowAsync <ArgumentNullException>(sut.Handle(null, It.IsAny <CancellationToken>()));
        }
        public async Task Handle_GivenInvalidRequest_ShouldThrowNotFoundException()
        {
            // Arrange
            var query = new GetPlayWeeksForTournamentTableQuery {
                TournamentTableId = 121
            };

            var tournamentsRepository = new EfDeletableEntityRepository <TournamentTable>(this.dbContext);

            var sut = new GetPlayWeeksForTournamentTableQueryHandler(this.deletableEntityRepository, tournamentsRepository, this.mapper);

            // Act & Assert
            await Should.ThrowAsync <NotFoundException>(sut.Handle(query, It.IsAny <CancellationToken>()));
        }
        public async Task Handle_GivenValidRequest_ShouldReturnViewModel()
        {
            // Arrange
            var query = new GetPlayWeeksForTournamentTableQuery {
                TournamentTableId = 1
            };

            var tournamentsRepository = new EfDeletableEntityRepository <TournamentTable>(this.dbContext);

            var sut = new GetPlayWeeksForTournamentTableQueryHandler(this.deletableEntityRepository, tournamentsRepository, this.mapper);

            // Act
            var viewModel = await sut.Handle(query, It.IsAny <CancellationToken>());

            // Assert
            viewModel.ShouldNotBeNull();
            viewModel.PlayWeeks.Count().ShouldBe(3);
        }