Ejemplo n.º 1
0
 public static void RunTests()
 {
     __didStartTests = true;
     CobraImp.TestBegan("RequireInBothA");
     CobraImp.TestEnded("RequireInBothA");
 }
Ejemplo n.º 2
0
public class Test : Object {  // 45
    public static void Main()            // 47
    {
        if (CobraCore._willCheckRequire) // 47
        {
            require_Main_2359_Test();
        }
        // locals
        RequireException re               = null;
        RequireInBothA   a1               = null;
        int                 i             = 0;
        RequireInBothB      b1            = null;
        NoRequireInBaseB    b2            = null;
        NoRequireInDerivedB b3            = null;
        RequireInBothB      b4            = null;
        bool                _lh_canEnsure = true;

        try {
            a1 = (new RequireInBothA());  // 48
            i  = (a1[1]);                 // 49
            bool _lh_expect_1001 = false; // 50
            try {                         // 51
                i = (a1[0]);              // 51
            }
            catch (RequireException) {
                // exactly what is expected
                _lh_expect_1001 = true;
            }
            catch (Exception _lh_expect_1002) {
                throw new ExpectException(typeof(RequireException), _lh_expect_1002);
            }
            if (!_lh_expect_1001)
            {
                throw new ExpectException(typeof(RequireException), null);
            }
            b1 = (new RequireInBothB());  // 52
            i  = (b1[1]);                 // 53
            i  = (b1[0]);                 // 54
            bool _lh_expect_1003 = false; // 55
            try {                         // 56
                i = (b1[(-1)]);           // 56
            }
            catch (RequireException) {
                // exactly what is expected
                _lh_expect_1003 = true;
            }
            catch (Exception _lh_expect_1004) {
                throw new ExpectException(typeof(RequireException), _lh_expect_1004);
            }
            if (!_lh_expect_1003)
            {
                throw new ExpectException(typeof(RequireException), null);
            }
            b2 = (new NoRequireInBaseB());    // 58
            i  = (b2[1]);                     // 59
            i  = (b2[0]);                     // 60
            b3 = (new NoRequireInDerivedB()); // 62
            bool _lh_expect_1005 = false;     // 63
            try {                             // 64
                i = (b3[0]);                  // 64
            }
            catch (RequireException) {
                // exactly what is expected
                _lh_expect_1005 = true;
            }
            catch (Exception _lh_expect_1006) {
                throw new ExpectException(typeof(RequireException), _lh_expect_1006);
            }
            if (!_lh_expect_1005)
            {
                throw new ExpectException(typeof(RequireException), null);
            }
            b4 = (new RequireInBothB());              // 67
            try{                                      // 69
                i = (b4[(-1)]);                       // 69
            }
            catch (RequireException _lh_catch_1008) { // 71
                re = _lh_catch_1008;
                if (CobraCore._willCheckAssert && !(CobraImp.IsNot((re.Next), null)))
                {
                    throw new AssertException("..\\Tests\\700-require-ensure\\606-inherit-require-indexer.cobra", 71, "re DOT next ISNOT nil", null);                                                                                   // 71
                }
                if (CobraCore._willCheckAssert && !(CobraImp.Is((re.Next.Next), null)))
                {
                    throw new AssertException("..\\Tests\\700-require-ensure\\606-inherit-require-indexer.cobra", 72, "re DOT next DOT next IS nil", null);                                                                                     // 72
                }
            }
        } catch {
            _lh_canEnsure = false;
            throw;
        } finally {         // ensure
            if (_lh_canEnsure)
            {
                if (CobraCore._willCheckEnsure)                    // 47
                {
                    ensure_Main_2359_Test();
                }
            }
        }
    }
Ejemplo n.º 3
0
 public static void RunTests()
 {
     __didStartTests = true;
     CobraImp.TestBegan("Test");
     CobraImp.TestEnded("Test");
 }
Ejemplo n.º 4
0
 public static new void RunTests()
 {
     __didStartTests = true;
     CobraImp.TestBegan("NoRequireInDerivedB");
     CobraImp.TestEnded("NoRequireInDerivedB");
 }