public void EvaluateTestIfContractIdIsSameAndIsClaimAdjudicatedIsTrue() { List <PaymentResult> paymentResults = new List <PaymentResult> { new PaymentResult { ClaimId = 123 }, new PaymentResult { ClaimId = 123, Line = 1 } }; // Arrange var mockContractRepository = new Mock <IContractRepository>(); 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 ContractLogic(mockContractRepository.Object, mockContractServiceTypeLogic.Object, mockPaymentResultLogic.Object); Contract contract = new Contract { ContractId = 123892, ContractName = "ABC", Conditions = new List <ICondition>(), ContractServiceTypes = new List <ContractServiceType> { new ContractServiceType { ContractServiceTypeId = 12, ContractServiceTypeName = "Service Type 1" } } , PaymentTypes = new List <PaymentTypeBase> { new PaymentTypeAscFeeSchedule { PaymentTypeId = (byte)Enums.PaymentTypeCodes.AscFeeSchedule, FacilityId = 1, ValidLineIds = new List <int> { 1 }, Conditions = new List <ICondition> { new Condition { ConditionOperator = (byte)Enums.ConditionOperation.EqualTo, LeftOperands = new List <string> { "30001" }, OperandType = (byte)Enums.OperandIdentifier.HcpcsCode, RightOperand = "30001" } }, ClaimFieldDoc = new ClaimFieldDoc { ClaimFieldValues = new List <ClaimFieldValue> { new ClaimFieldValue { Identifier = "30001", Value = "1" } } } } } }; _target.Contract = contract; IEvaluateableClaim evaluateableClaim = new EvaluateableClaim { LastAdjudicatedContractId = 123892, IsClaimAdjudicated = true }; evaluateableClaim.ClaimId = 123; evaluateableClaim.ClaimCharges = new List <ClaimCharge> { new ClaimCharge { Line = 1, Amount = 20, RevCode = "250", HcpcsCodeWithModifier = "30001", HcpcsCode = "30001", HcpcsModifiers = "26" } }; _target.AdjudicateClaims = new List <EvaluateableClaim>(); _target.EarlyExitClaims = new List <EvaluateableClaim>(); List <PaymentResult> updatedPaymentResults = new List <PaymentResult> { new PaymentResult { ClaimId = 123, ContractId = 1 }, new PaymentResult { ClaimId = 123, Line = 1, ContractId = 1 } }; 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 _target.Evaluate(evaluateableClaim, paymentResults, false, false); // Assert Assert.AreEqual(0, _target.AdjudicateClaims.Count); Assert.AreEqual(1, _target.EarlyExitClaims.Count); }