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

            _paymentTypePerCaseDetailsLogic = new PaymentTypePerCaseLogic(bubbleDataSource);
        }
Ejemplo n.º 2
0
        public void PaymentTypePerCaseDetailsConstructorUnitTest2()
        {
            _mockPaymentTypePerCaseRepository = new Mock <IPaymentTypePerCaseRepository>();
            PaymentTypePerCaseLogic target = new PaymentTypePerCaseLogic(_mockPaymentTypePerCaseRepository.Object);

            Assert.IsInstanceOfType(target, typeof(PaymentTypePerCaseLogic));
        }
Ejemplo n.º 3
0
        public void AddEditPaymentTypePerCaseIfNull()
        {
            _mockPaymentTypePerCaseRepository = new Mock <IPaymentTypePerCaseRepository>();
            _mockPaymentTypePerCaseRepository.Setup(f => f.AddEditPaymentTypePerCase(It.IsAny <PaymentTypePerCase>())).Returns(0);
            _target = new PaymentTypePerCaseLogic(_mockPaymentTypePerCaseRepository.Object);
            long actual = _target.AddEditPaymentType(null);

            Assert.AreEqual(0, actual);
        }
Ejemplo n.º 4
0
        public void GetPaymentPerCaseDetailsMockTestIfNull()
        {
            PaymentTypePerCase result = new PaymentTypePerCase();

            _mockPaymentTypePerCaseRepository = new Mock <IPaymentTypePerCaseRepository>();
            _mockPaymentTypePerCaseRepository.Setup(f => f.GetPaymentTypePerCase(It.IsAny <PaymentTypePerCase>())).Returns(result);
            _target = new PaymentTypePerCaseLogic(_mockPaymentTypePerCaseRepository.Object);
            PaymentTypePerCase actual = (PaymentTypePerCase)_target.GetPaymentType(null);

            Assert.AreEqual(result, actual);
        }
Ejemplo n.º 5
0
        public void EditPaymentTypePerCaseIfNotNull()
        {
            _mockPaymentTypePerCaseRepository = new Mock <IPaymentTypePerCaseRepository>();
            _mockPaymentTypePerCaseRepository.Setup(f => f.AddEditPaymentTypePerCase(It.IsAny <PaymentTypePerCase>())).Returns(1);
            _target = new PaymentTypePerCaseLogic(_mockPaymentTypePerCaseRepository.Object);
            PaymentTypePerCase objPaymentTypePerCase = new PaymentTypePerCase {
                PaymentTypeDetailId = 1
            };
            long actual = _target.AddEditPaymentType(objPaymentTypePerCase);

            Assert.AreEqual(1, actual);
        }
Ejemplo n.º 6
0
        public void GetPaymentPerCaseDetailsMockTestIfNotNull()
        {
            PaymentTypePerCase objPaymentTypePerCase = new PaymentTypePerCase {
                PaymentTypeId = 6, ContractId = 890, ServiceTypeId = null
            };
            PaymentTypePerCase result = new PaymentTypePerCase {
                Rate = 234, PaymentTypeDetailId = 678
            };

            _mockPaymentTypePerCaseRepository = new Mock <IPaymentTypePerCaseRepository>();
            _mockPaymentTypePerCaseRepository.Setup(f => f.GetPaymentTypePerCase(objPaymentTypePerCase)).Returns(result);
            _target = new PaymentTypePerCaseLogic(_mockPaymentTypePerCaseRepository.Object);
            PaymentTypePerCase actual = (PaymentTypePerCase)_target.GetPaymentType(objPaymentTypePerCase);

            Assert.AreEqual(result, actual);
        }
Ejemplo n.º 7
0
        public void EvaluatePaymentTypePayAtClaimLevel()
        {
            List <PaymentResult> paymentResults = new List <PaymentResult>
            {
                new PaymentResult {
                    ClaimId = 123, ServiceTypeId = 1
                },
                new PaymentResult {
                    ClaimId = 123, Line = 1, ServiceTypeId = 1
                }
            };
            PaymentTypePerCase paymentTypePerCase = new PaymentTypePerCase
            {
                PayAtClaimLevel = true,
                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,
                ValidLineIds  = new List <int> {
                    1
                },
                HcpcsCode      = "ABCDE",
                MaxCasesPerDay = 1,
                Rate           = 10
            };

            // Arrange
            _mockContractServiceTypeLogic = new Mock <IContractServiceTypeLogic>();
            _mockPaymentResultLogic       = new Mock <IPaymentResultLogic>();
            _mockPaymentResultLogic.Setup(
                x =>
                x.Evaluate(It.IsAny <EvaluateableClaim>(), It.IsAny <List <PaymentResult> >(), It.IsAny <bool>(),
                           It.IsAny <bool>())).Returns(paymentResults);
            _mockPaymentTypePerCaseRepository = new Mock <IPaymentTypePerCaseRepository>();
            _mockPaymentTypePerCaseRepository.Setup(x => x.GetPaymentTypePerCase(It.IsAny <PaymentTypePerCase>()))
            .Returns(paymentTypePerCase);

            _target = new PaymentTypePerCaseLogic(_mockPaymentTypePerCaseRepository.Object)
            {
                PaymentTypeBase = paymentTypePerCase
            };


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

            evaluateableClaim.ClaimId      = 123;
            evaluateableClaim.ClaimTotal   = 100;
            evaluateableClaim.ClaimCharges = new List <ClaimCharge>
            {
                new ClaimCharge
                {
                    Line      = 1,
                    Amount    = 20,
                    RevCode   = "250",
                    HcpcsCode = "ABCDE",
                    Units     = 2
                }
            };


            List <PaymentResult> updatedPaymentResults = new List <PaymentResult>
            {
                new PaymentResult {
                    ClaimId = 123, ContractId = 1, AdjudicatedValue = 110
                },
                new PaymentResult {
                    ClaimId = 123, Line = 1, ContractId = 1, AdjudicatedValue = 110
                }
            };

            _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(3, actual.Count);
            var firstOrDefault = paymentResults.FirstOrDefault(x => x.AdjudicatedValue != null);

            if (firstOrDefault != null)
            {
                Assert.AreEqual(10, firstOrDefault.AdjudicatedValue);
            }
        }
Ejemplo n.º 8
0
 public void PaymentTypePerCaseDetailsConstructorUnitTest1()
 {
     _target = new PaymentTypePerCaseLogic(Constants.ConnectionString);
     //Assert
     Assert.IsInstanceOfType(_target, typeof(PaymentTypePerCaseLogic));
 }