public async Task Then_If_There_Is_An_Error_A_Bad_Request_Is_Returned(
            [Frozen] Mock <IMediator> mediator,
            TrainingProgrammeController controller)
        {
            mediator
            .Setup(mediator => mediator.Send(
                       It.IsAny <GetAllTrainingProgrammesQuery>(),
                       It.IsAny <CancellationToken>()))
            .Throws <InvalidOperationException>();

            var controllerResult = await controller.GetAll() as StatusCodeResult;

            controllerResult.StatusCode.Should().Be((int)HttpStatusCode.BadRequest);
        }
        public async Task Then_The_Request_Is_Passed_To_Mediator_And_Data_Returned(
            GetAllTrainingProgrammesQueryResult result,
            [Frozen] Mock <IMediator> mediator,
            TrainingProgrammeController controller)
        {
            mediator.Setup(x => x.Send(It.IsAny <GetAllTrainingProgrammesQuery>(), CancellationToken.None)).ReturnsAsync(result);

            var actual = await controller.GetAll() as OkObjectResult;;

            //actual
            Assert.IsNotNull(actual);
            var model = actual.Value as GetAllTrainingProgrammesResponse;

            Assert.IsNotNull(model);
            model.TrainingProgrammes.Should().BeEquivalentTo(result.TrainingProgrammes);
        }