Exemplo n.º 1
0
        public async Task Handle_GivenValidRequest_ShouldThrowArgumentNullException()
        {
            // Arrange
            var sut = new GetAllTournamentsSelectListQueryHandler(It.IsAny <IDeletableEntityRepository <Tournament> >(), It.IsAny <IMapper>());

            // Act & Assert
            await Should.ThrowAsync <ArgumentNullException>(sut.Handle(null, It.IsAny <CancellationToken>()));
        }
Exemplo n.º 2
0
        public async Task Handle_GivenValidRequest_ShouldReturnIEnumerable()
        {
            // Arrange
            var query = new GetAllTournamentsSelectListQuery();
            var sut   = new GetAllTournamentsSelectListQueryHandler(this.deletableEntityRepository, this.mapper);

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

            // Assert
            collection.ShouldNotBeNull();
            collection.Count().ShouldBeGreaterThan(0);
        }