argit2() public method

public argit2 ( __arglist __arglist ) : void
__arglist __arglist
return void
Esempio n. 1
0
    private Boolean runTest(Boolean verbose)
    {
        int iCountErrors    = 0;
        int iCountTestcases = 0;

        try
        {
            ++iCountTestcases;
            if (verbose)
            {
                Console.WriteLine("GetNextArgType on Enumerator with no Elements in it should throw InvalidOperationException");
            }
            try {
                NormClass.argit1(__arglist(  ));
                ++iCountErrors;
                Console.WriteLine("Err_001b,  Expected exception was not thrown.");
            }
            catch (InvalidOperationException) {}
            catch (Exception ex) {
                ++iCountErrors;
                Console.WriteLine("Err_001a,  Unexpected exception was thrown ex: " + ex.ToString());
            }
            ++iCountTestcases;
            if (verbose)
            {
                Console.WriteLine("GetNextArgType on Enumerator after enumeration ended should result in InvalidOperationException");
            }
            try        {
                NormClass norm = new NormClass();
                norm.argit2(__arglist("a", "b", "c"));
            }
            catch (Exception ex) {
                ++iCountErrors;
                Console.WriteLine("Err_002a,  Unexpected exception was thrown ex: " + ex.ToString());
            }
        }
        catch (Exception exc_runTest)
        {
            ++iCountErrors;
            Console.Error.WriteLine(strName + " " + strTest + " " + strPath);
            Console.Error.WriteLine("Unexpected Exception (runTest99): " + exc_runTest.ToString());
        }
        Console.WriteLine();
        Console.WriteLine("FINAL TEST RESULT:" + strName + " " + strTest + " " + strPath);
        Console.WriteLine();
        if (iCountErrors == 0)
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }
 private Boolean runTest( Boolean verbose )
   {
   int iCountErrors = 0;
   int iCountTestcases = 0;
   try
     {
     ++iCountTestcases;   
     if ( verbose ) Console.WriteLine( "GetNextArgs on Enumerator with no Elements in it should throw InvalidOperationException" );	
     try{	
     NormClass.argit1( __arglist(  ) );
     ++iCountErrors;
     Console.WriteLine( "Err_001b,  Expected exception was not thrown." );
     }
     catch (InvalidOperationException) {}
     catch (Exception ex) {		
     ++iCountErrors;
     Console.WriteLine( "Err_001a,  Unexpected exception was thrown ex: " + ex.ToString() );
     }
     ++iCountTestcases;   
     if ( verbose ) Console.WriteLine( "GetNextArgs on Enumerator after enumeration ended should result in InvalidOperationException" );	
     try	{
     NormClass norm=new NormClass();
     norm.argit2( __arglist( "a", "b", "c" ) );	
     }
     catch (Exception ex) {
     ++iCountErrors;
     Console.WriteLine( "Err_002a,  Unexpected exception was thrown ex: " + ex.ToString() );
     }
     }
   catch (Exception exc_runTest)
     {
     ++iCountErrors;			
     Console.Error.WriteLine (strName+" "+strTest+" "+strPath);
     Console.Error.WriteLine ("Unexpected Exception (runTest99): "+exc_runTest.ToString());
     }
   Console.WriteLine ();
   Console.WriteLine ("FINAL TEST RESULT:" + strName+" "+strTest+" "+strPath);
   Console.WriteLine ();
   if ( iCountErrors == 0 ) {   return true; }
   else {  return false;}
   }
Esempio n. 3
0
    public Boolean runTest()
    {
        Console.Error.WriteLine(s_strTFPath + " " + s_strTFName + " , for " + s_strComponentBeingTested + "  ,Source ver " + s_strDtTmVer);
        int iCountTestcases = 0;
        int iCountErrors    = 0;

        ++iCountTestcases;
        if (verbose)
        {
            Console.WriteLine("call GetNextArgs on Enumerator with no Elements in it should throw InvalidOperationException");
        }
        try
        {
            NormClass.argit0(__arglist(  ));
            ++iCountErrors;
            Console.WriteLine("Err_001b,  Expected exception was not thrown.");
        }
        catch (InvalidOperationException)
        {}
        catch (Exception ex)
        {
            ++iCountErrors;
            Console.WriteLine("Err_001a,  Unexpected exception was thrown ex: " + ex.ToString());
        }
        ++iCountTestcases;
        if (verbose)
        {
            Console.WriteLine("call GetNextArgs on Enumerator after enumeration ended should result in InvalidOperationException");
        }
        try
        {
            NormClass.argit1(__arglist("a", "b", "c"));
        }
        catch (Exception ex)
        {
            ++iCountErrors;
            Console.WriteLine("Err_002a,  Unexpected exception was thrown ex: " + ex.ToString());
        }
        ++iCountTestcases;
        if (verbose)
        {
            Console.WriteLine("Make sure GetRemainingCount is correctly incremented decremented for different arglists");
        }
        try
        {
            NormStruct.argit0(__arglist( ));
            NormStruct.argit0(__arglist("a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c", "a", "b", "c"));
        }
        catch (Exception ex)
        {
            ++iCountErrors;
            Console.WriteLine("Err_003a,  Unexpected exception was thrown ex: " + ex.ToString());
        }
        ++iCountTestcases;
        if (verbose)
        {
            Console.WriteLine("call GetNextArgType on Enumerator with no Elements in it should throw InvalidOperationException");
        }
        try
        {
            NormClass.argit2(__arglist(  ));
            ++iCountErrors;
            Console.WriteLine("Err_004b,  Expected exception was not thrown.");
        }
        catch (InvalidOperationException)
        {}
        catch (Exception ex)
        {
            ++iCountErrors;
            Console.WriteLine("Err_004a,  Unexpected exception was thrown ex: " + ex.ToString());
        }
        ++iCountTestcases;
        if (verbose)
        {
            Console.WriteLine("call GetNextArgType on Enumerator after enumeration ended should result in InvalidOperationException");
        }
        try
        {
            NormClass.argit3(__arglist("a", "b", "c"));
        }
        catch (Exception ex)
        {
            ++iCountErrors;
            Console.WriteLine("Err_005a,  Unexpected exception was thrown ex: " + ex.ToString());
        }
        ++iCountTestcases;
        if (verbose)
        {
            Console.WriteLine("call GetNextArgType on Enumerator after enumeration ended should result in InvalidOperationException");
        }
        try
        {
            NormClass st = new NormClass();
            Object[]  o  = new Object[] { typeof(System.String), null, (int)1975, (long)6, (float)4.3, BindingFlags.NonPublic, new Object(), new Hashtable(), (char)'a', (byte)0x80, "Some String", Guid.NewGuid(), Int16.MinValue, DateTime.Now };
            st.argit6(o, __arglist((Type)o[0],
                                   o[1],
                                   (int)o[2],
                                   (long)o[3],
                                   (float)o[4],
                                   (BindingFlags)o[5],
                                   o[6],
                                   (Hashtable)o[7],
                                   (char)o[8],
                                   (byte)o[9],
                                   (String)o[10],
                                   (Guid)o[11],
                                   (short)o[12],
                                   (DateTime)o[13]));
        }
        catch (Exception ex)
        {
            ++iCountErrors;
            Console.WriteLine("Err_005a,  Unexpected exception was thrown ex: " + ex.ToString());
        }
        ++iCountTestcases;
        if (verbose)
        {
            Console.WriteLine("call GetNextArgType on Enumerator after enumeration ended should result in InvalidOperationException");
        }
        try
        {
            NormClass st = new NormClass();
            Object[,] compObj = new Object[2, 2];
            Object[] o = new Object[] { new DBNull[] {}, new Object[] {}, compObj };
            st.argit6(o, __arglist((DBNull[])o[0],
                                   (Object[])o[1],
                                   (Object[, ])o[2]));
        }
        catch (Exception ex)
        {
            ++iCountErrors;
            Console.WriteLine("Err_005a,  Unexpected exception was thrown ex: " + ex.ToString());
        }
        if (iCountErrors == 0)
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }
Esempio n. 4
0
    private Boolean runTest(Boolean verbose)
    {
        int iCountErrors    = 0;
        int iCountTestcases = 0;

        try
        {
            ++iCountTestcases;
            if (verbose)
            {
                Console.WriteLine("checking GetHashCode returns the same value ");
                Console.WriteLine("checking if we can use ArgIterators on any class");
            }
            try        {
                NormClass st = new NormClass();
                Object[]  o  = new Object[] { typeof(System.String), null, (int)1975, (long)6, (float)4.3, BindingFlags.NonPublic, new Object(), new Hashtable(), (char)'a', (byte)0x80, "Some String", Guid.NewGuid(), Int16.MinValue, DateTime.Now };
                st.argit1(o, __arglist((Type)o[0], o[1], (int)o[2], (long)o[3], (float)o[4], (BindingFlags)o[5], o[6], (Hashtable)o[7], (char)o[8], (byte)o[9], (String)o[10], (Guid)o[11], (short)o[12], (DateTime)o[13]));
            }
            catch (Exception ex) {
                ++iCountErrors;
                Console.WriteLine("Err_001a,  Unexpected exception was thrown ex: " + ex.ToString());
            }
            ++iCountTestcases;
            if (verbose)
            {
                Console.WriteLine("checking GetHashCode returns the same value ");
                Console.WriteLine("checking ArgIterators with Arrays");
            }
            try        {
                NormClass st = new NormClass();
                Object[,] compObj = new Object[2, 2];
                Object[] o = new Object[] { new DBNull[] {}, new Object[] {}, compObj };
                st.argit1(o, __arglist((DBNull[])o[0],
                                       (Object[])o[1],
                                       (Object[, ])o[2]));
            }
            catch (Exception ex) {
                ++iCountErrors;
                Console.WriteLine("Err_001b,  Unexpected exception was thrown ex: " + ex.ToString());
            }
            ++iCountTestcases;
            if (verbose)
            {
                Console.WriteLine("checking GetHashCode returns the same value ");
                Console.WriteLine("check nesting of ArgIterators ");
            }
            try        {
                NormClass.argit2(__arglist("a", "b", "c"));
            }
            catch (Exception ex) {
                ++iCountErrors;
                Console.WriteLine("Err_002a,  Unexpected exception was thrown ex: " + ex.ToString());
            }
        }
        catch (Exception exc_runTest)
        {
            ++iCountErrors;
            Console.Error.WriteLine(strName + " " + strTest + " " + strPath);
            Console.Error.WriteLine("Unexpected Exception (runTest99): " + exc_runTest.ToString());
        }
        Console.WriteLine();
        Console.WriteLine("FINAL TEST RESULT:" + strName + " " + strTest + " " + strPath);
        Console.WriteLine();
        if (iCountErrors == 0)
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }
Esempio n. 5
0
    private Boolean runTest(Boolean verbose)
    {
        int iCountErrors    = 0;
        int iCountTestcases = 0;

        try
        {
//TEST 1
            //Part A
            // [] check to see if we can use ArgIterators on any class
            ++iCountTestcases;
            try     {
                NormClass  st  = new NormClass();
                Object[]   o   = new Object[] { (int)1975 };
                TestStruct Bar = st.argit1(o, __arglist((int)o[0]));
            }
            catch (Exception ex) {
                ++iCountErrors;
                Console.WriteLine("Err_001a,  Unexpected exception was thrown ex: " + ex.ToString());
            }


            //Part B
            // [] check ArgIterators on Arrays
            ++iCountTestcases;
            if (verbose)
            {
                Console.WriteLine("checking GetHashCode returns the same value ");
                Console.WriteLine("checking ArgIterators with Arrays");
            }
            try     {
                NormClass st = new NormClass();
                Object[,] compObj = new Object[2, 2];

                Object[] o = new Object[] { new DBNull[] {}, new Object[] {}, compObj };
                st.argit1(o, __arglist((DBNull[])o[0],
                                       (Object[])o[1],
                                       (Object[, ])o[2]));
            }
            catch (Exception ex) {
                ++iCountErrors;
                Console.WriteLine("Err_001b,  Unexpected exception was thrown ex: " + ex.ToString());
            }
            //////////////////////////////////



//TEST 2
            // [] check nesting of ArgIterators
            ++iCountTestcases;
            if (verbose)
            {
                Console.WriteLine("checking GetHashCode returns the same value ");
                Console.WriteLine("check nesting of ArgIterators ");
            }
            try     {
                NormClass.argit2(__arglist("a", "b", "c"));
            }
            catch (Exception ex) {
                ++iCountErrors;
                Console.WriteLine("Err_002a,  Unexpected exception was thrown ex: " + ex.ToString());
            }
            //////////////////////////////////
        }


        catch (Exception exc_runTest)
        {
            ++iCountErrors;
            Console.Error.WriteLine(strName + " " + strTest + " " + strPath);
            Console.Error.WriteLine("Unexpected Exception (runTest99): " + exc_runTest.ToString());
        }



        //////////////////////////// Test Results ////////////////////////////////
        Console.WriteLine();
        Console.WriteLine("///////// FINAL TEST RESULT:" + strName + " " + strTest + " " + strPath);
        Console.WriteLine();
        //////////////////////////// Test Results ////////////////////////////////

        if (iCountErrors == 0)
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }