Example #1
0
        public void testCompareToDurationEQ()
        {
            System.Console.Out.WriteLine("TModelInstanceDetailsComparator.compare testCompareToDurationEQ");
            tModelInstanceInfo[] lhs = new tModelInstanceInfo[1] {
                new tModelInstanceInfo()
            };

            lhs[0].tModelKey       = ("hi");
            lhs[0].instanceDetails = new instanceDetails();
            lhs[0].instanceDetails.instanceParms = ("P5Y");
            tModelInstanceInfo[] rhs = new tModelInstanceInfo[1] {
                new tModelInstanceInfo()
            };


            rhs[0].tModelKey       = ("hi");
            rhs[0].instanceDetails = new instanceDetails();
            rhs[0].instanceDetails.instanceParms = ("P5Y");
            TModelInstanceDetailsComparator instance = new TModelInstanceDetailsComparator("hi", false, false, true);
            int result = instance.compare(lhs, rhs);

            Assert.True(result == 0, "result " + lhs[0].instanceDetails.instanceParms + " compare to " +
                        lhs[0].instanceDetails.instanceParms + " " +
                        result);
        }
Example #2
0
        public void testCompareToDateLT()
        {
            System.Console.Out.WriteLine("TModelInstanceDetailsComparator.compare testCompareToDateLT");
            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 = ("2005-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);
        }
Example #3
0
 public void testCompareToNulls4()
 {
     System.Console.Out.WriteLine("TModelInstanceDetailsComparator.compare nulls4");
     tModelInstanceInfo[]            lhs      = null;
     tModelInstanceInfo[]            rhs      = null;
     TModelInstanceDetailsComparator instance = new TModelInstanceDetailsComparator("hi", false, true, true);
     int expResult = 0;
     int result    = instance.compare(lhs, rhs);
 }
Example #4
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);
 }
Example #5
0
        public void testCompareToLHSNull()
        {
            System.Console.Out.WriteLine("TModelInstanceDetailsComparator.compare testCompareToLHSNull");
            tModelInstanceInfo[] lhs = new tModelInstanceInfo[1] {
                new tModelInstanceInfo()
            };

            lhs[0].tModelKey       = ("hi");
            lhs[0].instanceDetails = new instanceDetails();
            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);
        }
Example #6
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);
        }
Example #7
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);
        }