public async Task And_Then_No_Cohort_Is_Returned_From_Mediator(
            long cohortId,
            [Greedy] CohortController controller)
        {
            var controllerResult = await controller.Get(cohortId) as NotFoundResult;

            controllerResult.StatusCode.Should().Be((int)HttpStatusCode.NotFound);
        }
        public async Task And_Exception_Then_Returns_Bad_Request(
            long cohortId,
            [Frozen] Mock <IMediator> mockMediator,
            [Greedy] CohortController controller)
        {
            mockMediator
            .Setup(mediator => mediator.Send(
                       It.IsAny <GetCohortQuery>(),
                       It.IsAny <CancellationToken>()))
            .Throws <InvalidOperationException>();

            var controllerResult = await controller.Get(cohortId) as BadRequestResult;

            controllerResult.StatusCode.Should().Be((int)HttpStatusCode.BadRequest);
        }
        public async Task Then_Gets_Cohort_From_Mediator(
            long cohortId,
            GetCohortResult mediatorResult,
            [Frozen] Mock <IMediator> mockMediator,
            [Greedy] CohortController controller)
        {
            mockMediator
            .Setup(mediator => mediator.Send(
                       It.Is <GetCohortQuery>(x => x.CohortId == cohortId),
                       It.IsAny <CancellationToken>()))
            .ReturnsAsync(mediatorResult);

            var controllerResult = await controller.Get(cohortId) as ObjectResult;

            Assert.IsNotNull(controllerResult);
            controllerResult.StatusCode.Should().Be((int)HttpStatusCode.OK);
            var model = controllerResult.Value as GetCohortResult;

            Assert.IsNotNull(model);
            model.Should().BeEquivalentTo(mediatorResult);
        }