public async Task GivenTicketController_WhenGetByIdIsCalled_ThenReturnTicketWithId() { var id = ObjectId.GenerateNewId().ToString(); var result = await _controller.GetById(id); var okResult = result as OkObjectResult; okResult.Should().NotBeNull(); okResult.StatusCode.Should().Be(200); A.CallTo(() => _mediator.Send(A <GetTicketByIdQuery> ._, default)).MustHaveHappenedOnceExactly(); }