public async Task GetDatasetAggregations_GivenSpecificationIdButNullAggregationsFound_ReturnsOKObjectWithEmptyList()
        {
            //Arrange
            IDatasetsAggregationsRepository datasetsAggregationsRepository = CreateDatasetsAggregationsRepository();

            datasetsAggregationsRepository
            .GetDatasetAggregationsForSpecificationId(Arg.Is(SpecificationId))
            .Returns((IEnumerable <DatasetAggregations>)null);

            ProcessDatasetService processDatasetService = CreateProcessDatasetService(datasetsAggregationsRepository: datasetsAggregationsRepository);

            //Act
            IActionResult result = await processDatasetService.GetDatasetAggregationsBySpecificationId(SpecificationId);

            //Assert
            result
            .Should()
            .BeOfType <OkObjectResult>()
            .Which
            .Value
            .Should()
            .BeOfType <DatasetAggregations[]>()
            .Which
            .Length
            .Should()
            .Be(0);
        }
        public async Task GetDatasetAggregations_GivenSpecificationIdAndTwoAggregationsFound_ReturnsOKObjectWithTwoItems()
        {
            //Arrange
            IEnumerable <DatasetAggregations> datasetAggregations = new[]
            {
                new DatasetAggregations(),
                new DatasetAggregations()
            };

            IDatasetsAggregationsRepository datasetsAggregationsRepository = CreateDatasetsAggregationsRepository();

            datasetsAggregationsRepository
            .GetDatasetAggregationsForSpecificationId(Arg.Is(SpecificationId))
            .Returns(datasetAggregations);

            ProcessDatasetService processDatasetService = CreateProcessDatasetService(datasetsAggregationsRepository: datasetsAggregationsRepository);

            //Act
            IActionResult result = await processDatasetService.GetDatasetAggregationsBySpecificationId(SpecificationId);

            //Assert
            result
            .Should()
            .BeOfType <OkObjectResult>()
            .Which
            .Value
            .Should()
            .BeOfType <DatasetAggregations[]>()
            .Which
            .Length
            .Should()
            .Be(2);
        }
        public void SetUp()
        {
            _datasetRepository = CreateDatasetsRepository();
            _jobsApiClient     = CreateJobsApiClient();
            _messengerService  = CreateMessengerService();
            _jobManagement     = CreateJobManagement(_jobsApiClient, _logger, _messengerService);
            _logger            = CreateLogger();

            _service = CreateProcessDatasetService(
                datasetRepository: _datasetRepository,
                jobManagement: _jobManagement,
                messengerService: _messengerService,
                logger: _logger);

            _message = new Message();
        }