public void UpdateClaimStatusIfAdjudicatedValueIsNotNull() { _mockPaymentResultLogic = new Mock <IPaymentResultRepository>(); var paymentResults = new List <PaymentResult> { new PaymentResult { ClaimId = 123, ContractId = 101, AdjudicatedValue = 100 }, new PaymentResult { ClaimId = 123, ContractId = 101, ServiceTypeId = 10, AdjudicatedValue = 100 } }; var mockContractServiceTypeLogic = new Mock <IContractServiceTypeLogic>(); var mockPaymentResultLogic = new Mock <IPaymentResultLogic>(); mockPaymentResultLogic.Setup( x => x.Evaluate(It.IsAny <EvaluateableClaim>(), It.IsAny <List <PaymentResult> >(), It.IsAny <bool>(), It.IsAny <bool>())).Returns(paymentResults); _target = new PaymentResultLogic(_mockPaymentResultLogic.Object); IEvaluateableClaim evaluateableClaim = new EvaluateableClaim(); evaluateableClaim.ClaimId = 123; evaluateableClaim.ClaimCharges = new List <ClaimCharge> { new ClaimCharge { Line = 1, Amount = 20, RevCode = "250" } }; var updatedPaymentResults = new List <PaymentResult> { new PaymentResult { ClaimId = 123, AdjudicatedValue = 100, ContractId = 101, ServiceTypeId = 10 }, new PaymentResult { ClaimId = 123, ContractId = 101 } }; var mockContractBaseLogic = new Mock <ContractBaseLogic>(); mockContractServiceTypeLogic.Setup(x => x.Evaluate(evaluateableClaim, paymentResults, false, false)) .Returns(updatedPaymentResults); mockContractBaseLogic.SetupAllProperties(); //Act List <PaymentResult> actual = _target.Evaluate(evaluateableClaim, paymentResults, false, false); // Assert var firstOrDefault = actual.FirstOrDefault(q => q.ClaimStatus == 3); if (firstOrDefault != null) { Assert.AreEqual(3, firstOrDefault.ClaimStatus); } }
public void EvaluateIfLineIsNullTest() { _mockPaymentResultLogic = new Mock <IPaymentResultRepository>(); var paymentResults = new List <PaymentResult> { new PaymentResult { ClaimId = 123, ServiceTypeId = 1 }, new PaymentResult { ClaimId = 123, ServiceTypeId = 1 } }; var mockContractServiceTypeLogic = new Mock <IContractServiceTypeLogic>(); var mockPaymentResultLogic = new Mock <IPaymentResultLogic>(); mockPaymentResultLogic.Setup( x => x.Evaluate(It.IsAny <EvaluateableClaim>(), It.IsAny <List <PaymentResult> >(), It.IsAny <bool>(), It.IsAny <bool>())).Returns(paymentResults); _target = new PaymentResultLogic(_mockPaymentResultLogic.Object); IEvaluateableClaim evaluateableClaim = new EvaluateableClaim(); evaluateableClaim.ClaimId = 123; evaluateableClaim.ClaimCharges = new List <ClaimCharge> { new ClaimCharge { Line = 1, Amount = 20, RevCode = "250" } }; var updatedPaymentResults = new List <PaymentResult> { new PaymentResult { ClaimId = 123, Line = 1 }, new PaymentResult { ClaimId = 123 } }; var mockContractBaseLogic = new Mock <ContractBaseLogic>(); mockContractServiceTypeLogic.Setup(x => x.Evaluate(evaluateableClaim, paymentResults, false, false)) .Returns(updatedPaymentResults); mockContractBaseLogic.SetupAllProperties(); //Act List <PaymentResult> actual = _target.Evaluate(evaluateableClaim, paymentResults, false, false); // Assert Assert.AreEqual(updatedPaymentResults.Any(q => q.ClaimId != 0), actual.Any(q => q.ClaimId != 0)); }
public void UpdateAdjudicatedAmountIfPaymentResultNull() { _mockPaymentResultLogic = new Mock <IPaymentResultRepository>(); var paymentResults = new List <PaymentResult> { new PaymentResult { ClaimId = 123, Line = 1, ServiceTypeId = 10 }, new PaymentResult { ClaimId = 123, Line = 1, ServiceTypeId = 5 } }; var mockContractServiceTypeLogic = new Mock <IContractServiceTypeLogic>(); var mockPaymentResultLogic = new Mock <IPaymentResultLogic>(); mockPaymentResultLogic.Setup( x => x.Evaluate(It.IsAny <EvaluateableClaim>(), It.IsAny <List <PaymentResult> >(), It.IsAny <bool>(), It.IsAny <bool>())).Returns(paymentResults); _target = new PaymentResultLogic(_mockPaymentResultLogic.Object); IEvaluateableClaim evaluateableClaim = new EvaluateableClaim(); evaluateableClaim.ClaimId = 123; evaluateableClaim.ClaimCharges = new List <ClaimCharge> { new ClaimCharge { Line = 1, Amount = 20, RevCode = "250" } }; var updatedPaymentResults = new List <PaymentResult> { new PaymentResult { ClaimId = 123, Line = 1, ServiceTypeId = 10 }, new PaymentResult { ClaimId = 123, Line = 1, ServiceTypeId = 5 } }; var mockContractBaseLogic = new Mock <ContractBaseLogic>(); mockContractServiceTypeLogic.Setup(x => x.Evaluate(evaluateableClaim, paymentResults, false, false)) .Returns(updatedPaymentResults); mockContractBaseLogic.SetupAllProperties(); //Act List <PaymentResult> actual = _target.Evaluate(evaluateableClaim, paymentResults, false, false); // Assert Assert.AreEqual(true, actual.TrueForAll(q => q.AdjudicatedValue == null)); }