public async Task Handle_GivenNullRequest_ShouldThrowArgumentNullException() { // Arrange var sut = new GetTournamentsForGameQueryHandler(It.IsAny <IDeletableEntityRepository <Tournament> >(), It.IsAny <IMapper>()); // Act & Assert await Should.ThrowAsync <ArgumentNullException>(sut.Handle(null, It.IsAny <CancellationToken>())); }
public async Task Handle_GivenValidRequest_ShouldReturnViewModel() { // Arrange var query = new GetTournamentsForGameQuery { GameId = 1 }; var sut = new GetTournamentsForGameQueryHandler(this.deletableEntityRepository, this.mapper); // Act var viewModel = await sut.Handle(query, It.IsAny <CancellationToken>()); // Assert viewModel.ShouldNotBeNull(); viewModel.Tournaments.Count().ShouldBeGreaterThan(0); }