示例#1
0
        public void ServiceLineTableSelectionDetailsLogicConstructorUnitTest1()
        {
            var target = new ContractServiceTypeLogic(Constants.ConnectionString);

            //Assert
            Assert.IsInstanceOfType(target, typeof(ContractServiceTypeLogic));
        }
示例#2
0
        public void ServiceTypeDetailsLogicConstructorTest1()
        {
            _mockContractServiceTypeRepository = new Mock <IContractServiceTypeRepository>();
            ContractServiceTypeLogic target = new ContractServiceTypeLogic(_mockContractServiceTypeRepository.Object);

            Assert.IsInstanceOfType(target, typeof(ContractServiceTypeLogic));
        }
示例#3
0
        public void ServiceTypeDetailsLogicConstructorTest()
        {
            IContractServiceTypeRepository serviceTypeDetailsRepository = new ContractServiceTypeRepository(Constants.ConnectionString);
            ContractServiceTypeLogic       target = new ContractServiceTypeLogic(serviceTypeDetailsRepository);

            Assert.IsInstanceOfType(target, typeof(ContractServiceTypeLogic));
        }
        ContractServiceTypeController()
        {
            int    facilityId       = Convert.ToInt32(System.Web.HttpContext.Current.Request.Headers[Constants.BubbleDataSource]);
            string bubbleDataSource = GetFacilityConnection(facilityId);

            _serviceTypeDetailsLogic = new ContractServiceTypeLogic(bubbleDataSource);
        }
示例#5
0
        public void AddEditContractServiceTypeTest()
        {
            ContractServiceTypeLogic target = new ContractServiceTypeLogic(Constants.ConnectionString);
            const long expected             = 0;
            long       actual = target.AddEditContractServiceType(null);

            Assert.AreEqual(expected, actual);
        }
示例#6
0
        public void AddEditContractServiceTypeIfNull()
        {
            _mockContractServiceTypeRepository = new Mock <IContractServiceTypeRepository>();
            _mockContractServiceTypeRepository.Setup(f => f.AddEditContractServiceType(It.IsAny <ContractServiceType>())).Returns(0);
            ContractServiceTypeLogic target = new ContractServiceTypeLogic(_mockContractServiceTypeRepository.Object);
            long actual = target.AddEditContractServiceType(null);

            Assert.AreEqual(0, actual);
        }
示例#7
0
        public void GetAllContractServiceTypeUnitTestIfNull()
        {
            const long contractId             = 0;
            List <ContractServiceType> result = new List <ContractServiceType>();

            _mockContractServiceTypeRepository = new Mock <IContractServiceTypeRepository>();
            _mockContractServiceTypeRepository.Setup(f => f.GetAllContractServiceType(contractId)).Returns(result);
            ContractServiceTypeLogic   target = new ContractServiceTypeLogic(_mockContractServiceTypeRepository.Object);
            List <ContractServiceType> actual = target.GetAllContractServiceType(contractId);

            Assert.AreEqual(0, actual.Count);
        }
示例#8
0
        public void AddEditContractServiceTypeifNotNull()
        {
            _mockContractServiceTypeRepository = new Mock <IContractServiceTypeRepository>();
            _mockContractServiceTypeRepository.Setup(f => f.AddEditContractServiceType(It.IsAny <ContractServiceType>())).Returns(2);
            ContractServiceTypeLogic target = new ContractServiceTypeLogic(_mockContractServiceTypeRepository.Object);
            ContractServiceType      objAddEditContractServiceType = new ContractServiceType {
                ContractServiceTypeId = 1
            };
            long actual = target.AddEditContractServiceType(objAddEditContractServiceType);

            Assert.AreEqual(2, actual);
        }
示例#9
0
        public void CheckNameIfContractServiceTypeIsNull()
        {
            //Arrange
            _mockContractServiceTypeRepository = new Mock <IContractServiceTypeRepository>();
            _mockContractServiceTypeRepository.Setup(x => x.IsContractServiceTypeNameExit(null))
            .Returns(false);
            ContractServiceTypeLogic target = new ContractServiceTypeLogic(_mockContractServiceTypeRepository.Object);
            const bool expected             = false;
            //Act
            bool actual = target.IsContractServiceTypeNameExit(null);

            // Assert
            Assert.AreEqual(expected, actual);
        }
示例#10
0
        public void IfContractServiceTypeNameIsUnique()
        {
            //Arrange
            _mockContractServiceTypeRepository = new Mock <IContractServiceTypeRepository>();
            _mockContractServiceTypeRepository.Setup(x => x.IsContractServiceTypeNameExit(It.IsAny <ContractServiceType>()))
            .Returns(true);
            ContractServiceTypeLogic target = new ContractServiceTypeLogic(_mockContractServiceTypeRepository.Object);
            const bool expected             = true;

            //Act
            bool actual = target.IsContractServiceTypeNameExit(new ContractServiceType());

            // Assert
            Assert.AreEqual(expected, actual);
        }
示例#11
0
        public void GetAllContractServiceTypeUnitTestIfNotNull()
        {
            //Mock Input
            const long contractId = 354;

            //Mock output
            List <ContractServiceType> result = new List <ContractServiceType> {
                new ContractServiceType {
                    ContractServiceTypeName = "IP-Surgery", ContractServiceTypeId = 976
                }, new ContractServiceType {
                    ContractServiceTypeName = "OP-Surgery", ContractServiceTypeId = 542
                }
            };

            _mockContractServiceTypeRepository = new Mock <IContractServiceTypeRepository>();
            _mockContractServiceTypeRepository.Setup(f => f.GetAllContractServiceType(contractId)).Returns(result);
            ContractServiceTypeLogic   target = new ContractServiceTypeLogic(_mockContractServiceTypeRepository.Object);
            List <ContractServiceType> actual = target.GetAllContractServiceType(contractId);

            Assert.AreEqual(result, actual);
        }
示例#12
0
        public void EvaluateIfConditionNotMatch()
        {
            //Arrange
            EvaluateableClaim evaluateableClaim =
                new EvaluateableClaim
            {
                ClaimId     = 411930180,
                PatientData = new PatientData {
                    Dob = Convert.ToDateTime("1/1/2000")
                },
                AdjudicatedValue = 100.58,
                DiagnosisCodes   = new List <DiagnosisCode> {
                    new DiagnosisCode {
                        Instance = "P"
                    }
                },
                ClaimCharges = new List <ClaimCharge> {
                    new ClaimCharge {
                        Amount = 22, CoveredCharge = 22, HcpcsCode = "36415"
                    }
                },
                PriPayerName = "Medi",
                CustomField1 = "Test1"
            };

            List <PaymentResult> paymentResults = new List <PaymentResult>
            {
                new PaymentResult {
                    ClaimId = 411930180, ContractId = 101
                },
                new PaymentResult {
                    ClaimId = 411930180
                }
            };


            _mockContractServiceTypeRepository = new Mock <IContractServiceTypeRepository>();

            ContractServiceTypeLogic target = new ContractServiceTypeLogic(_mockContractServiceTypeRepository.Object)
            {
                ContractServiceType = new ContractServiceType
                {
                    Conditions = new List <ICondition>
                    {
                        new Condition
                        {
                            OperandType       = (int)Enums.OperandType.AlphaNumeric,
                            ConditionOperator = (int)Enums.ConditionOperation.EqualTo,
                            OperandIdentifier = (int)Enums.OperandIdentifier.PayerName,
                            LeftOperands      = new List <string> {
                                "Medicare", "Medi"
                            },
                            PropertyColumnName = Constants.PropertyPriPayerName,
                            RightOperand       = "Aetna"
                        }
                    }
                }
            };

            //Act
            var result = target.Evaluate(evaluateableClaim, paymentResults, false, false);

            //Assert
            Assert.AreEqual(result.Count, 2);
            var firstOrDefault = result.FirstOrDefault();

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