public async Task GetCalculationsMetadataForSpecification_GivenNoSpecificationId_ReturnsBadRequestObjectResult()
        {
            //Arrange
            string specificationId = null;

            ILogger logger = CreateLogger();

            CalculationService calculationService = CreateCalculationService(logger: logger);

            //Act
            IActionResult actionResult = await calculationService.GetCalculationsMetadataForSpecification(specificationId);

            //Assert
            actionResult
            .Should()
            .BeAssignableTo <BadRequestObjectResult>()
            .Which
            .Value
            .Should()
            .Be("Null or empty specificationId provided");

            logger
            .Received(1)
            .Error(Arg.Is($"No specificationId was provided to {nameof(calculationService.GetCalculationsMetadataForSpecification)}"));
        }
        public async Task GetCalculationsMetadataForSpecification_GivenItemsNotFoundInCacheButFoundInDatabase_ReturnsItems()
        {
            //Arrange
            List <CalculationMetadata> calculations = new List <CalculationMetadata>
            {
                new CalculationMetadata(),
                new CalculationMetadata()
            };

            string cacheKey = $"{CacheKeys.CalculationsMetadataForSpecification}{SpecificationId}";

            ICacheProvider cacheProvider = CreateCacheProvider();

            cacheProvider
            .GetAsync <List <CalculationMetadata> >(Arg.Is(cacheKey))
            .Returns((List <CalculationMetadata>)null);

            ICalculationsRepository calculationsRepository = CreateCalculationsRepository();

            calculationsRepository
            .GetCalculationsMetatadataBySpecificationId(Arg.Is(SpecificationId))
            .Returns(calculations);

            CalculationService calculationService = CreateCalculationService(
                cacheProvider: cacheProvider,
                calculationsRepository: calculationsRepository);

            //Act
            IActionResult actionResult = await calculationService.GetCalculationsMetadataForSpecification(SpecificationId);

            //Assert
            actionResult
            .Should()
            .BeAssignableTo <OkObjectResult>()
            .Which
            .Value
            .Should()
            .BeSameAs(calculations);

            await
            cacheProvider
            .Received(1)
            .SetAsync(Arg.Is(cacheKey), Arg.Any <List <CalculationMetadata> >());
        }