public void EvaluateAtLineLevelAmountIsNullTest() { List <PaymentResult> paymentResults = new List <PaymentResult> { new PaymentResult { ClaimId = 123, Line = 1, AdjudicatedValue = null, ServiceTypeId = 1, ContractId = 1 }, new PaymentResult { ClaimId = 123, Line = 2, AdjudicatedValue = null, ServiceTypeId = 1, ContractId = 1 }, }; PaymentTypePercentageCharge paymentTypePercentageCharge = new PaymentTypePercentageCharge { Percentage = 10, ValidLineIds = new List <int> { 1, 2, 3, 4, 5, 6 }, Conditions = new List <ICondition> { new Condition { ConditionOperator = (byte)Enums.ConditionOperation.EqualTo, LeftOperands = new List <string> { "300" }, OperandType = (byte)Enums.OperandIdentifier.HcpcsCode, RightOperand = "300" } }, ContractId = 1, HcpcsCode = "300", ServiceTypeId = 1 }; // Arrange 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); Mock <IPaymentTypePercentageChargeRepository> paymentTypePercentageChargeRepository = new Mock <IPaymentTypePercentageChargeRepository>(); paymentTypePercentageChargeRepository.Setup(x => x.GetPaymentTypePercentageDiscountDetails(It.IsAny <PaymentTypePercentageCharge>())) .Returns(paymentTypePercentageCharge); var target = new PaymentTypePercentageChargeLogic(paymentTypePercentageChargeRepository.Object) { PaymentTypeBase = paymentTypePercentageCharge }; // _target.Contract = contract; IEvaluateableClaim evaluateableClaim = new EvaluateableClaim(); evaluateableClaim.ClaimId = 123; evaluateableClaim.ClaimTotal = 100; evaluateableClaim.ClaimCharges = new List <ClaimCharge> { new ClaimCharge { Line = 1, HcpcsCode = "300" }, new ClaimCharge { Line = 2, HcpcsCode = "301" }, new ClaimCharge { Line = 3, HcpcsCode = "302" }, new ClaimCharge { Line = 4, HcpcsCode = "303" }, new ClaimCharge { Line = 5, HcpcsCode = "304" }, new ClaimCharge { Line = 6, HcpcsCode = "305" } }; List <PaymentResult> updatedPaymentResults = new List <PaymentResult> { new PaymentResult { ClaimId = 123, ContractId = 1, AdjudicatedValue = 110 }, new PaymentResult { ClaimId = 123, Line = 1, ContractId = 1, AdjudicatedValue = 110 } }; Mock <ContractBaseLogic> mockContractBaseLogic = new Mock <ContractBaseLogic>(); mockContractServiceTypeLogic.Setup(x => x.IsValidServiceType()).Returns(true); mockContractServiceTypeLogic.Setup(x => x.Evaluate(evaluateableClaim, paymentResults, false, false)) .Returns(updatedPaymentResults); mockContractBaseLogic.SetupAllProperties(); //Act List <PaymentResult> actual = target.EvaluatePaymentType(evaluateableClaim, paymentResults, false, false); // Assert Assert.AreEqual(2, actual.Count); var firstOrDefault = paymentResults.FirstOrDefault(x => x.AdjudicatedValue != null); Assert.IsNull(firstOrDefault); }