public void PaymentTypeLesserOfRepositoryConstructorUnitTest1() { var mockPaymentTypeLesserOf = new Mock <IPaymentTypeLesserOfRepository>(); _target = new PaymentTypeLesserOfLogic(mockPaymentTypeLesserOf.Object); Assert.IsInstanceOfType(_target, typeof(PaymentTypeLesserOfLogic)); }
/// <summary> /// Default Constructor /// </summary> public PaymentTypeLesserOfController() { int facilityId = Convert.ToInt32(System.Web.HttpContext.Current.Request.Headers[Constants.BubbleDataSource]); string bubbleDataSource = GetFacilityConnection(facilityId); _paymentTypeLesserOfLogic = new PaymentTypeLesserOfLogic(bubbleDataSource); }
public void AddNewPaymentTypeFeeScheduleIfNull() { var mockAddPaymentTypeLessorOf = new Mock <IPaymentTypeLesserOfRepository>(); mockAddPaymentTypeLessorOf.Setup(f => f.AddEditPaymentTypeLesserOf(It.IsAny <PaymentTypeLesserOf>())).Returns(1); _target = new PaymentTypeLesserOfLogic(mockAddPaymentTypeLessorOf.Object); long actual = _target.AddEditPaymentType(null); Assert.AreEqual(1, actual); }
public void AddPaymentTypeLessorOfIfNotNull() { var mockAddPaymentTypeLessorOf = new Mock <IPaymentTypeLesserOfRepository>(); mockAddPaymentTypeLessorOf.Setup(f => f.AddEditPaymentTypeLesserOf(It.IsAny <PaymentTypeLesserOf>())).Returns(1); _target = new PaymentTypeLesserOfLogic(mockAddPaymentTypeLessorOf.Object); PaymentTypeLesserOf objAddPaymentTypeLessorOf = new PaymentTypeLesserOf { ContractId = 1, Percentage = 50 }; _target.AddEditPaymentType(objAddPaymentTypeLessorOf); Assert.IsNotNull(true); }
public void PaymentTypeLesserOfLogicLogicParameterlessConstructorTest() { _target = new PaymentTypeLesserOfLogic(Constants.ConnectionString); //Assert Assert.IsInstanceOfType(_target, typeof(PaymentTypeLesserOfLogic)); }
public void EvaluateLesserOfTestForApplyContractFilter() { List <PaymentResult> paymentResults = new List <PaymentResult> { new PaymentResult { ClaimId = 123, AdjudicatedValue = 110, ClaimTotalCharges = 110, ServiceTypeId = 1 }, new PaymentResult { ClaimId = 123, Line = 1, AdjudicatedValue = 110, ClaimTotalCharges = 110, ServiceTypeId = 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 <IPaymentTypeLesserOfRepository> paymentTypeLesserOfRepository = new Mock <IPaymentTypeLesserOfRepository>(); paymentTypeLesserOfRepository.Setup(x => x.GetLesserOfPercentage(It.IsAny <PaymentTypeLesserOf>())) .Returns(new PaymentTypeLesserOf()); PaymentTypeLesserOf paymentTypeLesserOf = new PaymentTypeLesserOf { Conditions = new List <ICondition> { new Condition { ConditionOperator = (byte)Enums.ConditionOperation.EqualTo, LeftOperands = new List <string> { "300" }, OperandType = (byte)Enums.OperandIdentifier.HcpcsCode, RightOperand = "300" } }, ServiceTypeId = 1, ValidLineIds = new List <int> { 1, 2 }, HcpcsCode = "ABCDE", ContractId = 1, IsLesserOf = true, Percentage = 50 }; _target = new PaymentTypeLesserOfLogic(paymentTypeLesserOfRepository.Object) { PaymentTypeBase = paymentTypeLesserOf }; IEvaluateableClaim evaluateableClaim = new EvaluateableClaim(); evaluateableClaim.ClaimId = 123; evaluateableClaim.ClaimTotal = 100; evaluateableClaim.ClaimCharges = new List <ClaimCharge> { new ClaimCharge { Line = 1, Amount = 20, RevCode = "250" } }; List <PaymentResult> updatedPaymentResults = new List <PaymentResult> { new PaymentResult { ClaimId = 123, ContractId = 1, AdjudicatedValue = 110, ClaimTotalCharges = 110, ServiceTypeId = 1 }, new PaymentResult { ClaimId = 123, Line = 1, ContractId = 1, AdjudicatedValue = 110, ClaimTotalCharges = 110, ServiceTypeId = 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 List <PaymentResult> actual = _target.EvaluatePaymentType(evaluateableClaim, paymentResults, false, true); // Assert Assert.AreEqual(2, actual.Count); var firstOrDefault = paymentResults.FirstOrDefault(); if (firstOrDefault != null) { Assert.AreEqual(50, firstOrDefault.AdjudicatedValue); } }