public void GetCalculationSummariesForSpecification_WhenGivenASpecificationIdInValidFormat_ShouldReturnResult()
        {
            // Arrange
            List <Common.ApiClient.Calcs.Models.CalculationSummary> summaryModels = new List <Common.ApiClient.Calcs.Models.CalculationSummary>()
            {
                new Common.ApiClient.Calcs.Models.CalculationSummary()
                {
                    Name            = "TestCalc",
                    CalculationType = Common.ApiClient.Calcs.Models.CalculationType.Template,
                    Id = "CalcId"
                }
            };

            ICalculationsApiClient mockApi = Substitute.For <ICalculationsApiClient>();

            mockApi
            .GetCalculationSummariesForSpecification(Arg.Any <string>())
            .Returns(new ApiResponse <IEnumerable <Common.ApiClient.Calcs.Models.CalculationSummary> >(HttpStatusCode.OK, summaryModels));

            CalculationsRepository calculationsRepository = new CalculationsRepository(mockApi, CreateMapper());

            // Act
            var configuredTaskAwaiter = calculationsRepository.GetCalculationSummariesForSpecification("Test").ConfigureAwait(false).GetAwaiter();
            List <CalculationSummaryModel> calculationSummaryModels = configuredTaskAwaiter.GetResult().ToList();

            // Assert
            calculationSummaryModels.Should().NotBeNull();
            calculationSummaryModels.Should().BeEquivalentTo(summaryModels);
            mockApi.Received(1).GetCalculationSummariesForSpecification(Arg.Any <string>());
        }
        public void GetCalculationSummariesForSpecification_WhenSpeficationIdIsEmpty_ShouldThrowException()
        {
            // Arrange
            ICalculationsApiClient apiClientProxy         = Substitute.For <ICalculationsApiClient>();
            CalculationsRepository calculationsRepository = new CalculationsRepository(apiClientProxy, CreateMapper());
            ArgumentNullException  exception = null;

            // Act
            try
            {
                var configuredTaskAwaiter = calculationsRepository.GetCalculationSummariesForSpecification(string.Empty).ConfigureAwait(false).GetAwaiter();
                configuredTaskAwaiter.GetResult();
            }
            catch (Exception e)
            {
                exception = e as ArgumentNullException;
            }

            // Assert
            exception.Should().NotBeNull();
            exception.Should().BeOfType <ArgumentNullException>();
            apiClientProxy.DidNotReceive().GetCalculationSummariesForSpecification(Arg.Any <string>());
        }