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

            // Act & Assert
            await Should.ThrowAsync <ArgumentNullException>(sut.Handle(null, It.IsAny <CancellationToken>()));
        }
        public async Task Handle_GivenInvalidRequest_ShouldThrowNotFoundException()
        {
            // Arrange
            var query = new GetTeamDetailsQuery {
                Id = 131
            };
            var sut = new GetTeamDetailsQueryHandler(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 GetTeamDetailsQuery {
                Id = 1
            };
            var userAccessorMock = new Mock <IUserAccessor>();

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

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

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

            // Assert
            viewModel.ShouldNotBeNull();
            viewModel.Name.ShouldBe("FooTeam1");
            viewModel.IsOwner.ShouldBe(true);
            viewModel.IsMember.ShouldBe(true);
        }