Exemplo n.º 1
0
        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));
                }
            }
        }
Exemplo n.º 2
0
 /// <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));
 }
Exemplo n.º 3
0
 /// <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));
 }
Exemplo n.º 4
0
 public WebApiRequest()
     : this(string.Format("http://{0}/ClaimCaptureService", GeneralUtility.GetMachineRedirect()))
 {
 }