public void CostEstimatesTest()
        {
            CostEstimatesResponse actualResponse = costEstimates.Get(CostEstimatesParams());

            string expectedResponse = TestHelper.GetJson(TestResource.ExpectedResponse + "CostEstimates.json");

            TestHelper.CompareProperties(expectedResponse, actualResponse.JsonResponse());

            CostEstimatesResponse expectedObj = JsonConvert.DeserializeObject <CostEstimatesResponse>(expectedResponse);
            CostEstimatesResponse actualObj   = JsonConvert.DeserializeObject <CostEstimatesResponse>(actualResponse.JsonResponse());

            TestHelper.PropertyValuesAreEquals(actualObj, expectedObj);
        }
Ejemplo n.º 2
0
        public void CostEstimateNoCoverageTest()
        {
            CostEstimates costEstimates      = new CostEstimates();
            var           costEstimateParams = GetCoverageDependentParams();

            costEstimateParams["member_id"]      = "ERROR_034";
            costEstimateParams["service_type"]   = "4";
            costEstimateParams["network"]        = "IN";
            costEstimateParams["provider_price"] = "99.00";

            try
            {
                costEstimates.Get(costEstimateParams);
            }
            catch (EligibleService.Exceptions.EligibleException ex)
            {
                Assert.IsNotNull(ex.EligibleError.EligibleId);
                Assert.IsNotNull(ex.EligibleError.CreatedAt);
                Assert.AreEqual("api_error", ex.EligibleError.Errors[0].Code);
                Assert.AreEqual("The payer did not return coverage information for the service type requested.", ex.EligibleError.Errors[0].Message);
                Assert.AreEqual(null, ex.EligibleError.Errors[0].ExpectedValue);
                Assert.AreEqual(null, ex.EligibleError.Errors[0].Param);
                Assert.AreEqual(null, ex.EligibleError.Errors[0].Path);
                Assert.AreEqual(false, ex.EligibleError.Success);
            }
        }
Ejemplo n.º 3
0
        public void CostEstimateProviderPriseNotFoundTest()
        {
            CostEstimates costEstimates      = new CostEstimates();
            var           costEstimateParams = GetCoverageDependentParams();

            costEstimateParams["member_id"]    = "ERROR_034";
            costEstimateParams["service_type"] = "4";
            costEstimateParams["network"]      = "IN";

            try
            {
                costEstimates.Get(costEstimateParams);
            }
            catch (EligibleService.Exceptions.EligibleException ex)
            {
                Assert.IsNotNull(ex.EligibleError.EligibleId);
                Assert.IsNotNull(ex.EligibleError.CreatedAt);
                Assert.AreEqual("invalid_request_error", ex.EligibleError.Errors[0].Code);
                Assert.AreEqual("provider_price should be present and should be a valid price", ex.EligibleError.Errors[0].Message);
                Assert.AreEqual(null, ex.EligibleError.Errors[0].ExpectedValue);
                Assert.AreEqual("provider_price", ex.EligibleError.Errors[0].Param);
                Assert.AreEqual(null, ex.EligibleError.Errors[0].Path);
                Assert.AreEqual(false, ex.EligibleError.Success);
            }
        }
Ejemplo n.º 4
0
        public void GetCostEstimatesTest()
        {
            restClient.Setup(x => x.Execute(It.IsAny <string>(), It.IsAny <RequestOptions>(), It.IsAny <Hashtable>()))
            .Returns(new RestResponse()
            {
                StatusCode = HttpStatusCode.OK,
                Content    = TestHelper.GetJson(TestResource.MocksPath + "CostEstimate.json")
            });


            costEstimates.ExecuteObj = restClient.Object;

            var acknowledgements = costEstimates.Get(param);

            Assert.IsNotNull(acknowledgements);
        }