public void PaymentTypeMedicareLabFeeScheduleConstructorTest1()
        {
            var mockPaymentTypeMedicareLabFeeSchedulePayment = new Mock <IPaymentTypeMedicareLabFeeScheduleRepository>();
            PaymentTypeMedicareLabFeeScheduleLogic target    = new PaymentTypeMedicareLabFeeScheduleLogic(mockPaymentTypeMedicareLabFeeSchedulePayment.Object);

            Assert.IsInstanceOfType(target, typeof(PaymentTypeMedicareLabFeeScheduleLogic));
        }
        public void PaymentTypeMedicareLabFeeScheduleConstructorTest()
        {
            IPaymentTypeMedicareLabFeeScheduleRepository paymentTypeMedicareLabFeeScheduleRepository = new PaymentTypeMedicareLabFeeScheduleRepository(Constants.ConnectionString);
            PaymentTypeMedicareLabFeeScheduleLogic       target = new PaymentTypeMedicareLabFeeScheduleLogic(paymentTypeMedicareLabFeeScheduleRepository);

            Assert.IsInstanceOfType(target, typeof(PaymentTypeMedicareLabFeeScheduleLogic));
        }
        //Testing AuditLog constructor without parameter
        public void PaymentTypeMedicareLabFeeScheduleParameterlessConstructorTest()
        {
            var target = new PaymentTypeMedicareLabFeeScheduleLogic(Constants.ConnectionString);

            //Assert
            Assert.IsInstanceOfType(target, typeof(PaymentTypeMedicareLabFeeScheduleLogic));
        }
Example #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PaymentTypeMedicareLabFeeScheduleController"/> class.
        /// </summary>
        public PaymentTypeMedicareLabFeeScheduleController()
        {
            int    facilityId       = Convert.ToInt32(System.Web.HttpContext.Current.Request.Headers[Constants.BubbleDataSource]);
            string bubbleDataSource = GetFacilityConnection(facilityId);

            _medicareLabFeeScheduleDetailsLogic = new PaymentTypeMedicareLabFeeScheduleLogic(bubbleDataSource);
        }
        public void AddEditMedicareLabFeeScheduleWithNullPayment()
        {
            var mockAddEditPaymentTypeMedicareLabFeeSchedulePayment = new Mock <IPaymentTypeMedicareLabFeeScheduleRepository>();

            mockAddEditPaymentTypeMedicareLabFeeSchedulePayment.Setup(f => f.AddEditPaymentTypeMedicareLabFeeSchedulePayment(It.IsAny <PaymentTypeMedicareLabFeeSchedule>())).Returns(1);
            PaymentTypeMedicareLabFeeScheduleLogic target = new PaymentTypeMedicareLabFeeScheduleLogic(mockAddEditPaymentTypeMedicareLabFeeSchedulePayment.Object);
            long actual = target.AddEditPaymentType(null);

            Assert.AreEqual(1, actual);
        }
        public void GetPaymentTypeMedicareLabFeeScheduleTest()
        {
            PaymentTypeMedicareLabFeeSchedule objAddEditPaymentTypeMedicareLabFeeSchedulePayment = new PaymentTypeMedicareLabFeeSchedule {
                PaymentTypeDetailId = 1, PaymentTypeId = 4, ContractId = 234, ServiceTypeId = null
            };
            var mockGetPaymentTypeStopLoss           = new Mock <IPaymentTypeMedicareLabFeeScheduleRepository>();
            PaymentTypeMedicareLabFeeSchedule result = new PaymentTypeMedicareLabFeeSchedule();

            mockGetPaymentTypeStopLoss.Setup(f => f.GetPaymentTypeMedicareLabFeeSchedulePayment(objAddEditPaymentTypeMedicareLabFeeSchedulePayment)).Returns(result);
            PaymentTypeMedicareLabFeeScheduleLogic target = new PaymentTypeMedicareLabFeeScheduleLogic(mockGetPaymentTypeStopLoss.Object);
            PaymentTypeMedicareLabFeeSchedule      actual = (PaymentTypeMedicareLabFeeSchedule)target.GetPaymentType(null);

            Assert.AreEqual(null, actual);
        }
        public void AddEditMedicareLabFeeScheduleWithValidDataTest()
        {
            var mockAddEditPaymentTypeMedicareLabFeeSchedulePayment = new Mock <IPaymentTypeMedicareLabFeeScheduleRepository>();

            mockAddEditPaymentTypeMedicareLabFeeSchedulePayment.Setup(f => f.AddEditPaymentTypeMedicareLabFeeSchedulePayment(It.IsAny <PaymentTypeMedicareLabFeeSchedule>())).Returns(1);
            PaymentTypeMedicareLabFeeScheduleLogic target = new PaymentTypeMedicareLabFeeScheduleLogic(mockAddEditPaymentTypeMedicareLabFeeSchedulePayment.Object);
            PaymentTypeMedicareLabFeeSchedule      objAddEditPaymentTypeMedicareLabFeeSchedulePayment = new PaymentTypeMedicareLabFeeSchedule {
                PaymentTypeDetailId = 1
            };

            long actual = target.AddEditPaymentType(objAddEditPaymentTypeMedicareLabFeeSchedulePayment);

            Assert.IsNotNull(actual);
        }
        public void EvaluateTestAtLineLevelWithOnlyHcpcCodeTest()
        {
            List <PaymentResult> paymentResults = new List <PaymentResult>
            {
                new PaymentResult {
                    ClaimId = 123, ServiceTypeId = 1, Line = 2
                },
                new PaymentResult {
                    ClaimId = 123, Line = 1, ServiceTypeId = 1
                }
            };
            PaymentTypeMedicareLabFeeSchedule paymentTypeMedicareLabFeeSchedule = new PaymentTypeMedicareLabFeeSchedule
            {
                Conditions = new List <ICondition>
                {
                    new Condition
                    {
                        ConditionOperator = (byte)Enums.ConditionOperation.EqualTo,
                        LeftOperands      = new List <string> {
                            "ABCDE"
                        },
                        OperandType  = (byte)Enums.OperandIdentifier.HcpcsCode,
                        RightOperand = "ABCDE"
                    }
                },
                ServiceTypeId = 1,
                Percentage    = 50,
                ValidLineIds  = new List <int> {
                    1, 2
                },
                HcpcsCode = "ABCDE"
            };
            // 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 <IPaymentTypeMedicareLabFeeScheduleRepository> paymentTypeMedicareLabFeeScheduleRepository = new Mock <IPaymentTypeMedicareLabFeeScheduleRepository>();

            paymentTypeMedicareLabFeeScheduleRepository.Setup(x => x.GetPaymentTypeMedicareLabFeeSchedulePayment(It.IsAny <PaymentTypeMedicareLabFeeSchedule>()))
            .Returns(paymentTypeMedicareLabFeeSchedule);

            var target = new PaymentTypeMedicareLabFeeScheduleLogic(paymentTypeMedicareLabFeeScheduleRepository.Object)
            {
                PaymentTypeBase = paymentTypeMedicareLabFeeSchedule
            };


            // _target.Contract = contract;
            IEvaluateableClaim evaluateableClaim = new EvaluateableClaim();

            evaluateableClaim.ClaimId    = 123;
            evaluateableClaim.ClaimTotal = 100;
            evaluateableClaim.MedicareLabFeeSchedules = new List <MedicareLabFeeSchedule>
            {
                new MedicareLabFeeSchedule
                {
                    Amount  = 10,
                    Carrier = "ABCDE",
                    Hcpcs   = "ABCDE",
                    HcpcsCodeWithModifier = "ABCDE"
                }
            };
            evaluateableClaim.ClaimCharges = new List <ClaimCharge>
            {
                new ClaimCharge
                {
                    Line                  = 1,
                    Amount                = 20,
                    RevCode               = "250",
                    HcpcsCode             = "ABCDE",
                    Units                 = 2,
                    HcpcsCodeWithModifier = "ABCDE26",
                    HcpcsModifiers        = "26"
                },
                new ClaimCharge
                {
                    Line                  = 2,
                    Amount                = 200,
                    RevCode               = "250",
                    HcpcsCode             = "ABCDF",
                    Units                 = 2,
                    HcpcsCodeWithModifier = "ABCDF26",
                    HcpcsModifiers        = "26"
                }
            };


            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.IsNotNull(firstOrDefault);
        }