public void TestSedgwickRuleProcessor() { const string asiDisabilityAttribute = "ASI:CTA_EMPLOYEE_BEGIN_DISABILITY_DT"; using (var call = new CallWrapper()) { call.LoadFromDSN("7679", GeneralUtility.GetDsnFromInstance(DbBaseClass.SEDBA)); var myCall = new CallObject(); myCall.LoadFromXml(call.GetXML()); var originalDate = myCall.GetValue(asiDisabilityAttribute); //NUnit.Framework.Assert.IsTrue(originalDate.Length == 8, "Bad date format!"); var records = RuleRecordSet.GetRuleSetByClientAndEvent("18", "CLOSE", "SEDBA"); NUnit.Framework.Assert.IsTrue(records.Count >= 1, "Problems!"); foreach (var record in records) { var results = Eval.EvaluateCallObject(myCall.ToXml(), record.RuleText); NUnit.Framework.Assert.IsNotEmpty(results, "Nothing returned!"); var resultCall = new CallObject(); resultCall.LoadFromXml(results); NUnit.Framework.Assert.IsNotEmpty(resultCall.GetValue(asiDisabilityAttribute), "Expected result was not returned!"); NUnit.Framework.Assert.IsFalse(originalDate.Equals((resultCall.GetValue(asiDisabilityAttribute))), "dates are unchanged!"); Console.WriteLine("Original: {0} Transformed: {1}", originalDate, resultCall.GetValue(asiDisabilityAttribute)); } } }
/// <summary> /// Loads the entity. /// </summary> /// <param name="rquId">The rquId identifier.</param> /// <returns>The data</returns> /// <exception cref="System.ApplicationException">Unable to retrieve entity id: + rquId</exception> protected static string LoadEntity(string rquId) { return(GeneralUtility.LoadEntity(rquId)); }
/// <summary> /// Gets the request rquid from the call if it exists. /// Otherwise it creates and sets it. /// </summary> protected string GetRequestRquId(ICall call) { return(GeneralUtility.GetRequestRquId(call)); }
public WebApiRequest() : this(string.Format("http://{0}/ClaimCaptureService", GeneralUtility.GetMachineRedirect())) { }