コード例 #1
0
        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);
        }
コード例 #2
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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
 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);
 }
コード例 #6
0
 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);
 }
コード例 #7
0
        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);
        }