Beispiel #1
0
        public void CSharpEmptyReturnStatementTest()
        {
            ReturnStatement returnStatement = ParseUtilCSharp.ParseStatement <ReturnStatement>("return;");

            Assert.IsTrue(returnStatement.Expression.IsNull);
        }
Beispiel #2
0
        public void CSharpGotoStatementTest()
        {
            GotoStatement gotoStmt = ParseUtilCSharp.ParseStatement <GotoStatement>("goto myLabel;");

            Assert.AreEqual("myLabel", gotoStmt.Label);
        }
Beispiel #3
0
 public void CSharpContinueStatementTest()
 {
     ContinueStatement continueStmt = ParseUtilCSharp.ParseStatement <ContinueStatement>("continue;");
 }
        public void CSharpLabel2StatementTest()
        {
            LabelStatement labelStmt = ParseUtilCSharp.ParseStatement <LabelStatement>("yield: ; ");

            Assert.AreEqual("yield", labelStmt.Label);
        }
Beispiel #5
0
        public void CSharpStatementExpressionTest1()
        {
            ExpressionStatement stmtExprStmt = ParseUtilCSharp.ParseStatement <ExpressionStatement>("yield.yield;");

            Assert.IsTrue(stmtExprStmt.Expression is MemberReferenceExpression);
        }
Beispiel #6
0
 public void CSharpUsingStatementTest()
 {
     UsingStatement usingStmt = ParseUtilCSharp.ParseStatement <UsingStatement>("using (MyVar var = new MyVar()) { } ");
     // TODO : Extend test.
 }
Beispiel #7
0
 public void CSharpSimpleTryCatchFinallyStatementTest()
 {
     TryCatchStatement tryCatchStatement = ParseUtilCSharp.ParseStatement <TryCatchStatement>("try { } catch (Exception) { } finally { } ");
     // TODO : Extend test.
 }
        public void CSharpGotoCaseDefaltStatementTest()
        {
            GotoCaseStatement gotoCaseStmt = ParseUtilCSharp.ParseStatement <GotoCaseStatement>("goto default;");

            Assert.IsTrue(gotoCaseStmt.IsDefaultCase);
        }
Beispiel #9
0
        public void CSharpThrowStatementTest()
        {
            ThrowStatement throwStmt = ParseUtilCSharp.ParseStatement <ThrowStatement>("throw new Exception();");

            Assert.IsTrue(throwStmt.Expression is ObjectCreateExpression);
        }
Beispiel #10
0
 public void CSharpSimpleTryCatchStatementTest()
 {
     TryCatchStatement tryCatchStatement = ParseUtilCSharp.ParseStatement <TryCatchStatement>("try { } catch { } ");
     // TODO : Extend test.
 }
Beispiel #11
0
        public void CSharpEmptyThrowStatementTest()
        {
            ThrowStatement throwStmt = ParseUtilCSharp.ParseStatement <ThrowStatement>("throw;");

            Assert.IsTrue(throwStmt.Expression.IsNull);
        }
Beispiel #12
0
 public void CSharpForeachStatementTest()
 {
     ForeachStatement foreachStmt = ParseUtilCSharp.ParseStatement <ForeachStatement>("foreach (int i in myColl) {} ");
     // TODO : Extend test.
 }
Beispiel #13
0
        public void CSharpCheckedStatementTest()
        {
            CheckedStatement checkedStatement = ParseUtilCSharp.ParseStatement <CheckedStatement>("checked { }");

            Assert.IsFalse(checkedStatement.Block.IsNull);
        }
 public void CSharpFixedStatementTest()
 {
     FixedStatement fixedStmt = ParseUtilCSharp.ParseStatement <FixedStatement>("fixed (int* ptr = &myIntArr) { }");
     // TODO : Extend test.
 }
 public void CSharpLockStatementTest()
 {
     LockStatement lockStmt = ParseUtilCSharp.ParseStatement <LockStatement>("lock (myObj) {}");
     // TODO : Extend test.
 }
Beispiel #16
0
 public void CSharpBlockStatementTest()
 {
     BlockStatement blockStmt = ParseUtilCSharp.ParseStatement <BlockStatement>("{}");
 }
Beispiel #17
0
 public void CSharpBreakStatementTest()
 {
     BreakStatement breakStmt = ParseUtilCSharp.ParseStatement <BreakStatement>("break;");
 }
Beispiel #18
0
        public void CSharpStatementExpressionTest()
        {
            ExpressionStatement stmtExprStmt = ParseUtilCSharp.ParseStatement <ExpressionStatement>("my.Obj.PropCall;");

            Assert.IsTrue(stmtExprStmt.Expression is MemberReferenceExpression);
        }
        public void YieldBreakStatementTest()
        {
            YieldStatement yieldStmt = ParseUtilCSharp.ParseStatement <YieldStatement>("yield break;");

            Assert.IsTrue(yieldStmt.IsYieldBreak);
        }
Beispiel #20
0
        public void CSharpUnsafeStatementTest()
        {
            UnsafeStatement unsafeStatement = ParseUtilCSharp.ParseStatement <UnsafeStatement>("unsafe { }");

            Assert.IsFalse(unsafeStatement.Block.IsNull);
        }
Beispiel #21
0
 public void CSharpForStatementTest()
 {
     ForStatement forStmt = ParseUtilCSharp.ParseStatement <ForStatement>("for (int i = 5; i < 6; ++i) {} ");
     // TODO : Extend test.
 }