예제 #1
0
 public override bool Equals(object obj)
 {
     if (obj is RefX1 <T> )
     {
         RefX1 <T> v = (RefX1 <T>)obj;
         return(CompareTo(v) == 0);
     }
     return(false);
 }
예제 #2
0
 public int CompareTo(RefX1 <T> obj)
 {
     if (null == obj)
     {
         return(1);
     }
     if (null == _val)
     {
         if (null == obj.Val)
         {
             return(0);
         }
         else
         {
             return(-1);
         }
     }
     return(_val.CompareTo(obj.Val));
 }
예제 #3
0
        public static void ICollectionTests()
        {
            Driver <RefX1 <int> > IntDriver = new Driver <RefX1 <int> >();

            RefX1 <int>[] intArr = new RefX1 <int> [100];
            for (int i = 0; i < 100; i++)
            {
                intArr[i] = new RefX1 <int>(i);
            }

            IntDriver.TestICollection(intArr);

            Driver <ValX1 <string> > StringDriver = new Driver <ValX1 <string> >();

            ValX1 <string>[] stringArr = new ValX1 <string> [100];
            for (int i = 0; i < 100; i++)
            {
                stringArr[i] = new ValX1 <string>("SomeTestString" + i.ToString());
            }

            StringDriver.TestICollection(stringArr);
        }
예제 #4
0
        public static void NonGenericGetEnumeratorTests()
        {
            Driver <RefX1 <int> > IntDriver = new Driver <RefX1 <int> >();

            RefX1 <int>[] intArr = new RefX1 <int> [100];
            for (int i = 0; i < 100; i++)
            {
                intArr[i] = new RefX1 <int>(i);
            }

            IntDriver.GetEnumeratorBasic(intArr);
            IntDriver.GetEnumeratorValidations(intArr);

            Driver <ValX1 <string> > StringDriver = new Driver <ValX1 <string> >();

            ValX1 <string>[] stringArr = new ValX1 <string> [100];
            for (int i = 0; i < 100; i++)
            {
                stringArr[i] = new ValX1 <string>("SomeTestString" + i.ToString());
            }

            StringDriver.GetEnumeratorBasic(stringArr);
            StringDriver.GetEnumeratorValidations(stringArr);
        }
예제 #5
0
 public bool Equals(RefX1 <T> x)
 {
     return(0 == CompareTo(x));
 }
예제 #6
0
        public static void GenericGetEnumeratorTests()
        {
            Driver <RefX1 <int> > RefIntDriver = new Driver <RefX1 <int> >();
            Driver <ValX1 <int> > ValIntDriver = new Driver <ValX1 <int> >();
            Driver <int>          IntDriver    = new Driver <int>();

            Driver <RefX1 <String> > RefStringDriver = new Driver <RefX1 <String> >();
            Driver <ValX1 <String> > ValStringDriver = new Driver <ValX1 <String> >();
            Driver <String>          StringDriver    = new Driver <String>();

            RefX1 <int>[] refIntArr = new RefX1 <int> [100];
            ValX1 <int>[] valIntArr = new ValX1 <int> [100];
            int[]         intArr    = new int[100];

            RefX1 <String>[] refStringArr = new RefX1 <String> [100];
            ValX1 <String>[] valStringArr = new ValX1 <String> [100];
            String[]         stringArr    = new String[100];

            for (int i = 0; i < 100; i++)
            {
                refIntArr[i] = new RefX1 <int>(i);
                valIntArr[i] = new ValX1 <int>(i);
                intArr[i]    = i;

                refStringArr[i] = new RefX1 <String>(i.ToString());
                valStringArr[i] = new ValX1 <String>(i.ToString());
                stringArr[i]    = i.ToString();
            }


            /*****************************************************
            *  Int
            *****************************************************/
            //GetEnumeratorBasic
            RefIntDriver.List_GetEnumeratorBasic(refIntArr);
            ValIntDriver.List_GetEnumeratorBasic(valIntArr);
            IntDriver.List_GetEnumeratorBasic(intArr);

            RefIntDriver.List_GetEnumeratorBasic(new RefX1 <int> [0]);
            ValIntDriver.List_GetEnumeratorBasic(new ValX1 <int> [0]);
            IntDriver.List_GetEnumeratorBasic(new int[0]);

            RefIntDriver.List_GetEnumeratorBasic(new RefX1 <int>[] { null });

            //GetEnumeratorValidations
            RefIntDriver.List_GetEnumeratorValidations(refIntArr);
            ValIntDriver.List_GetEnumeratorValidations(valIntArr);
            IntDriver.List_GetEnumeratorValidations(intArr);

            RefIntDriver.List_GetEnumeratorValidations(new RefX1 <int> [0]);
            ValIntDriver.List_GetEnumeratorValidations(new ValX1 <int> [0]);
            IntDriver.List_GetEnumeratorValidations(new int[0]);

            RefIntDriver.List_GetEnumeratorValidations(new RefX1 <int>[] { null });


            /*****************************************************
            *  String
            *****************************************************/
            //GetEnumeratorBasic
            RefStringDriver.List_GetEnumeratorBasic(refStringArr);
            ValStringDriver.List_GetEnumeratorBasic(valStringArr);
            StringDriver.List_GetEnumeratorBasic(stringArr);

            RefStringDriver.List_GetEnumeratorBasic(new RefX1 <String> [0]);
            ValStringDriver.List_GetEnumeratorBasic(new ValX1 <String> [0]);
            StringDriver.List_GetEnumeratorBasic(new String[0]);

            RefStringDriver.List_GetEnumeratorBasic(new RefX1 <String>[] { null });

            //GetEnumeratorValidations
            RefStringDriver.List_GetEnumeratorValidations(refStringArr);
            ValStringDriver.List_GetEnumeratorValidations(valStringArr);
            StringDriver.List_GetEnumeratorValidations(stringArr);

            RefStringDriver.List_GetEnumeratorValidations(new RefX1 <String> [0]);
            ValStringDriver.List_GetEnumeratorValidations(new ValX1 <String> [0]);
            StringDriver.List_GetEnumeratorValidations(new String[0]);

            RefStringDriver.List_GetEnumeratorValidations(new RefX1 <String>[] { null });
        }