/// <summary>
        /// Initializes a new instance of the <see cref="PaymentTypeDrgController"/> class.
        /// </summary>
        public PaymentTypeDrgController()
        {
            int    facilityId       = Convert.ToInt32(System.Web.HttpContext.Current.Request.Headers[Constants.BubbleDataSource]);
            string bubbleDataSource = GetFacilityConnection(facilityId);

            _paymentTypeDrgPaymentLogic = new PaymentTypeDrgLogic(bubbleDataSource);
        }
Exemplo n.º 2
0
        public void PaymentTypeDrgPaymentConstructorUnitTest2()
        {
            var mockPaymentTypeDrgPayment = new Mock <IPaymentTypeDrgPaymentRepository>();
            PaymentTypeDrgLogic target    = new PaymentTypeDrgLogic(mockPaymentTypeDrgPayment.Object);

            Assert.IsInstanceOfType(target, typeof(PaymentTypeDrgLogic));
        }
Exemplo n.º 3
0
        public void PaymentTypeDrgPaymentConstructorUnitTest1()
        {
            IPaymentTypeDrgPaymentRepository productRepository = new PaymentTypeDrgRepository(Constants.ConnectionString);
            PaymentTypeDrgLogic target = new PaymentTypeDrgLogic(productRepository);

            Assert.IsInstanceOfType(target, typeof(PaymentTypeDrgLogic));
        }
Exemplo n.º 4
0
        //Testing AuditLog constructor without parameter
        public void PaymentTypeDrgLogicParameterlessConstructorTest()
        {
            var target = new PaymentTypeDrgLogic(Constants.ConnectionString);

            //Assert
            Assert.IsInstanceOfType(target, typeof(PaymentTypeDrgLogic));
        }
Exemplo n.º 5
0
        public void AddNewPaymentTypeDrgPaymentIfNull()
        {
            var mockPaymentTypeDrgPayment = new Mock <IPaymentTypeDrgPaymentRepository>();

            mockPaymentTypeDrgPayment.Setup(f => f.AddEditPaymentTypeDrgPayment(It.IsAny <PaymentTypeDrg>())).Returns(1);
            PaymentTypeDrgLogic target = new PaymentTypeDrgLogic(mockPaymentTypeDrgPayment.Object);
            long actual = target.AddEditPaymentType(null);

            Assert.AreEqual(1, actual);
        }
Exemplo n.º 6
0
        public void GetPaymentTypeDrgPaymentMockTest1()
        {
            PaymentTypeDrg objAddNewPaymentTypeDrgPayment = new PaymentTypeDrg {
                PaymentTypeDetailId = 1
            };

            var mockPaymentTypeDrgPayment = new Mock <IPaymentTypeDrgPaymentRepository>();

            mockPaymentTypeDrgPayment.Setup(f => f.GetPaymentTypeDrgPayment(It.IsAny <PaymentTypeDrg>())).Returns(objAddNewPaymentTypeDrgPayment);
            PaymentTypeDrgLogic target = new PaymentTypeDrgLogic(mockPaymentTypeDrgPayment.Object);

            PaymentTypeDrg actual = (PaymentTypeDrg)target.GetPaymentType(null);

            Assert.AreEqual(1, actual.PaymentTypeDetailId);
        }
Exemplo n.º 7
0
        public void GetAllRelativeWeightListTest()
        {
            var mockPaymentTypeDrgPayment            = new Mock <IPaymentTypeDrgPaymentRepository>();
            List <RelativeWeight> relativeWeightList = new List <RelativeWeight>
            {
                new RelativeWeight
                {
                    RelativeWeightId    = 1,
                    RelativeWeightValue = "100"
                }
            };

            mockPaymentTypeDrgPayment.Setup(f => f.GetAllRelativeWeightList()).Returns(relativeWeightList);
            PaymentTypeDrgLogic target = new PaymentTypeDrgLogic(mockPaymentTypeDrgPayment.Object);
            var actual = target.GetAllRelativeWeightList();

            Assert.IsNotNull(actual);
            Assert.AreEqual(1, actual.Count);
        }
Exemplo n.º 8
0
        public void EvaluateIfPaymentResultsLineIsNotNullTest()
        {
            List <PaymentResult> paymentResults = new List <PaymentResult>
            {
                new PaymentResult {
                    ClaimId = 123, Line = null, AdjudicatedValue = null, ServiceTypeId = 1
                },
            };
            PaymentTypeDrg paymentTypeDrg = new PaymentTypeDrg
            {
                RelativeWeightId = 10,
                BaseRate         = 10,
                Conditions       = new List <ICondition>
                {
                    new Condition
                    {
                        ConditionOperator = (byte)Enums.ConditionOperation.EqualTo,
                        LeftOperands      = new List <string> {
                            "300"
                        },
                        OperandType  = (byte)Enums.OperandIdentifier.HcpcsCode,
                        RightOperand = "300"
                    }
                },
                ClaimFieldDoc = new ClaimFieldDoc
                {
                    ClaimFieldValues = new List <ClaimFieldValue>
                    {
                        new ClaimFieldValue
                        {
                            Identifier = "ABCDE",
                            Value      = "100"
                        }
                    }
                },
                ServiceTypeId = 1,
                ValidLineIds  = new List <int> {
                    1, 2
                },
                HcpcsCode  = "ABCDE",
                ContractId = 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 <IPaymentTypeDrgPaymentRepository> paymentTypeDrgPaymentRepository = new Mock <IPaymentTypeDrgPaymentRepository>();

            paymentTypeDrgPaymentRepository.Setup(x => x.GetPaymentTypeDrgPayment(It.IsAny <PaymentTypeDrg>()))
            .Returns(paymentTypeDrg);

            var target = new PaymentTypeDrgLogic(paymentTypeDrgPaymentRepository.Object)
            {
                PaymentTypeBase = paymentTypeDrg
            };


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

            evaluateableClaim.ClaimId      = 123;
            evaluateableClaim.Drg          = "ABCDE";
            evaluateableClaim.ClaimTotal   = 100;
            evaluateableClaim.ClaimCharges = new List <ClaimCharge>
            {
                new ClaimCharge
                {
                    Line      = 1,
                    Amount    = 20,
                    HcpcsCode = "300"
                },
                new ClaimCharge
                {
                    Line      = 2,
                    Amount    = 20,
                    HcpcsCode = "301"
                },
                new ClaimCharge
                {
                    Line      = 3,
                    Amount    = 20,
                    HcpcsCode = "302"
                },
                new ClaimCharge
                {
                    Line      = 4,
                    Amount    = 20,
                    HcpcsCode = "303"
                },
                new ClaimCharge
                {
                    Line      = 5,
                    Amount    = 20,
                    HcpcsCode = "304"
                },
                new ClaimCharge
                {
                    Line      = 6,
                    Amount    = 20,
                    HcpcsCode = "ABCDE"
                }
            };


            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);

            if (firstOrDefault != null)
            {
                Assert.AreEqual(1000, firstOrDefault.AdjudicatedValue);
            }
        }