public void testCompareToDate() { System.Console.Out.WriteLine("TModelInstanceDetailsComparator.compare testCompareToDate"); tModelInstanceInfo[] lhs = new tModelInstanceInfo[1] { new tModelInstanceInfo() }; lhs[0].tModelKey = ("hi"); lhs[0].instanceDetails = new instanceDetails(); lhs[0].instanceDetails.instanceParms = ("asdasd"); tModelInstanceInfo[] rhs = new tModelInstanceInfo[1] { new tModelInstanceInfo() }; rhs[0].tModelKey = ("hi"); rhs[0].instanceDetails = new instanceDetails(); rhs[0].instanceDetails.instanceParms = ("asdasdasd"); TModelInstanceDetailsComparator instance = new TModelInstanceDetailsComparator("hi", false, true, false); int result = instance.compare(lhs, rhs); //Assert.assertTrue("result " + result,result < 0); }
public void testCompareToDateEQ() { System.Console.Out.WriteLine("TModelInstanceDetailsComparator.compare testCompareToDateEQ"); tModelInstanceInfo[] lhs = new tModelInstanceInfo[1] { new tModelInstanceInfo() }; lhs[0].tModelKey = ("hi"); lhs[0].instanceDetails = new instanceDetails(); lhs[0].instanceDetails.instanceParms = ("2002-05-30T09:30:10-06:00"); tModelInstanceInfo[] rhs = new tModelInstanceInfo[1] { new tModelInstanceInfo() }; rhs[0].tModelKey = ("hi"); rhs[0].instanceDetails = new instanceDetails(); rhs[0].instanceDetails.instanceParms = ("2002-05-30T09:30:10-06:00"); TModelInstanceDetailsComparator instance = new TModelInstanceDetailsComparator("hi", false, true, false); int result = instance.compare(lhs, rhs); Assert.True(result == 0, "result " + lhs[0].instanceDetails.instanceParms + " compare to " + rhs[0].instanceDetails.instanceParms + " " + result); }
public void testCompareToRHSNull() { System.Console.Out.WriteLine("TModelInstanceDetailsComparator.compare testCompareToRHSNull"); tModelInstanceInfo[] lhs = new tModelInstanceInfo[1] { new tModelInstanceInfo() }; lhs[0].tModelKey = ("hi"); lhs[0].instanceDetails = new instanceDetails(); lhs[0].instanceDetails.instanceParms = ("xyz"); tModelInstanceInfo[] rhs = new tModelInstanceInfo[1] { new tModelInstanceInfo() }; rhs[0].tModelKey = ("hi"); rhs[0].instanceDetails = new instanceDetails(); //rhs[0].instanceDetails.instanceParms=("xyz"); TModelInstanceDetailsComparator instance = new TModelInstanceDetailsComparator("hi", true, false, false); int expResult = 0; int result = instance.compare(lhs, rhs); }
public void testCompareToNumberDataLT() { System.Console.Out.WriteLine("TModelInstanceDetailsComparator.compare testCompareToNumberDataLT"); tModelInstanceInfo[] lhs = new tModelInstanceInfo[1] { new tModelInstanceInfo() }; lhs[0].tModelKey = ("hi"); lhs[0].instanceDetails = new instanceDetails(); lhs[0].instanceDetails.instanceParms = ("3.10"); tModelInstanceInfo[] rhs = new tModelInstanceInfo[1] { new tModelInstanceInfo() }; rhs[0].tModelKey = ("hi"); rhs[0].instanceDetails = new instanceDetails(); rhs[0].instanceDetails.instanceParms = ("3.14"); TModelInstanceDetailsComparator instance = new TModelInstanceDetailsComparator("hi", true, false, false); int result = instance.compare(lhs, rhs); Assert.True(result < 0, "result " + result); }
public void testCompareToNulls8() { System.Console.Out.WriteLine("TModelInstanceDetailsComparator.compare nulls8"); tModelInstanceInfo[] lhs = null; tModelInstanceInfo[] rhs = null; TModelInstanceDetailsComparator instance = new TModelInstanceDetailsComparator("hi", true, false, false); int expResult = 0; int result = instance.compare(lhs, rhs); }
public void testCompareToNotFound() { System.Console.Out.WriteLine("TModelInstanceDetailsComparator.compare notfound"); tModelInstanceInfo[] lhs = new tModelInstanceInfo[1] { new tModelInstanceInfo() }; lhs[0].tModelKey = ("asd"); tModelInstanceInfo[] rhs = new tModelInstanceInfo[1] { new tModelInstanceInfo() }; rhs[0].tModelKey = ("asd"); rhs[0].instanceDetails = new instanceDetails(); TModelInstanceDetailsComparator instance = new TModelInstanceDetailsComparator("hi", true, false, false); int expResult = 0; int result = instance.compare(lhs, rhs); }
public void testCompareToDurationInvalid() { System.Console.Out.WriteLine("TModelInstanceDetailsComparator.compare testCompareToDurationInvalid"); tModelInstanceInfo[] lhs = new tModelInstanceInfo[1] { new tModelInstanceInfo() }; lhs[0].tModelKey = ("hi"); lhs[0].instanceDetails = new instanceDetails(); lhs[0].instanceDetails.instanceParms = ("asdasd"); tModelInstanceInfo[] rhs = new tModelInstanceInfo[1] { new tModelInstanceInfo() }; rhs[0].tModelKey = ("hi"); rhs[0].instanceDetails = new instanceDetails(); rhs[0].instanceDetails.instanceParms = ("asdasd"); TModelInstanceDetailsComparator instance = new TModelInstanceDetailsComparator("hi", false, false, true); int result = instance.compare(lhs, rhs); Assert.True(result == 0, "result " + result); }