public async Task Handle_GivenNullRequest_ShouldThrowArgumentNullException()
        {
            // Arrange
            var sut = new GetTournamentDetailsQueryHandler(It.IsAny <IDeletableEntityRepository <Tournament> >(), It.IsAny <IMapper>(), It.IsAny <IUserAccessor>());

            // Act & Assert
            await Should.ThrowAsync <ArgumentNullException>(sut.Handle(null, It.IsAny <CancellationToken>()));
        }
        public async Task Handle_GivenNullRequest_ShouldReturnArgumentNullException()
        {
            // Arrange
            var query = new GetTournamentDetailsQuery {
                Id = 122
            };
            var sut = new GetTournamentDetailsQueryHandler(this.deletableEntityRepository, It.IsAny <IMapper>(), It.IsAny <IUserAccessor>());

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

            userAccessorMock.Setup(x => x.UserId).Returns("Foo1");

            var sut = new GetTournamentDetailsQueryHandler(this.deletableEntityRepository, this.mapper, userAccessorMock.Object);

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

            // Assert
            viewModel.ShouldNotBeNull();
            viewModel.ShouldBeOfType <GetTournamentDetailsViewModel>();
            viewModel.IsCurrentUserInAnEnrolledTeam.ShouldBe(true);
            viewModel.Name.ShouldBe("TestTournament1");
        }