public void CanGetPlanInfo() { SqlMapper.SetTypeMap(typeof(HealthPlanSummary), new ColumnAttributeTypeMapper <HealthPlanSummary>()); var service = new PlanInfoService(); var summary = service.GetHealthPlanSummaryAsync(11, 57020).Result; Assert.IsNotNull(summary); Assert.IsFalse(string.IsNullOrEmpty(summary.PlanName)); Assert.AreNotEqual(0, summary.Deductible); Assert.IsFalse(summary.AsOfDate.HasValue); Assert.IsFalse(summary.YearToDateSpent.HasValue); Assert.AreNotEqual(0, summary.Deductible); Assert.IsTrue(!summary.Coinsurance.HasValue || !summary.Coinsurance.Value.Equals(0)); Assert.AreNotEqual(0, summary.CoinsuranceComplement); Assert.IsTrue(!summary.Copay.HasValue || !summary.Copay.Value.Equals(0)); Assert.AreNotEqual(0, summary.OutOfPocketMax); // Test accounts won't have accumulators data. //summary = service.GetHealthPlanSummaryAsync(11, 21).Result; //Assert.IsNotNull(summary); //Assert.IsFalse(string.IsNullOrEmpty(summary.PlanName)); //Assert.AreNotEqual(0, summary.Deductible); //Assert.IsTrue(summary.AsOfDate.HasValue); //Assert.IsTrue(summary.YearToDateSpent.HasValue); //Assert.AreNotEqual(0, summary.Deductible); //Assert.IsTrue(!summary.Coinsurance.HasValue || !summary.Coinsurance.Value.Equals(0)); //Assert.AreNotEqual(0, summary.CoinsuranceComplement); //Assert.IsTrue(!summary.Copay.HasValue || !summary.Copay.Value.Equals(0)); //Assert.AreNotEqual(0, summary.OutOfPocketMax); }
public async Task <HttpResponseMessage> Get() { var service = new PlanInfoService(); var summary = await service.GetHealthPlanSummaryAsync(Request.EmployerID(), Request.CCHID()); if (!summary.AsOfDate.HasValue || !summary.YearToDateSpent.HasValue) { service.SubmitBenefitInquiry(Request.EmployerID(), Request.CCHID()); } return(Request.CreateResponse(HttpStatusCode.OK, (object)summary)); }