A statement that asserts that a condition must always be true when execution reaches it. For example the assert statement of Spec#.
Inheritance: Statement, IAssertStatement
Ejemplo n.º 1
0
 private void AddAssertion(IExpression condition)
 {
     AssertStatement assertStatement = new AssertStatement();
       assertStatement.Condition = condition;
       this.GetOrCreateStmtListForStmt(this.currentStatement).Add(assertStatement);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Visits the specified assert statement.
 /// </summary>
 /// <param name="assertStatement">The assert statement.</param>
 /// <returns></returns>
 protected virtual IStatement DeepCopy(AssertStatement assertStatement)
 {
     assertStatement.Condition = this.Substitute(assertStatement.Condition);
       return assertStatement;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Visits the specified assert statement.
 /// </summary>
 /// <param name="assertStatement">The assert statement.</param>
 public override void Visit(IAssertStatement assertStatement)
 {
     AssertStatement mutableAssertStatement = new AssertStatement(assertStatement);
     this.resultStatement = this.myCodeCopier.DeepCopy(mutableAssertStatement);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Rewrites the children of the given assert statement.
 /// </summary>
 /// <param name="assertStatement"></param>
 public virtual void RewriteChildren(AssertStatement assertStatement)
 {
     this.RewriteChildren((Statement)assertStatement);
       assertStatement.Condition = this.Rewrite(assertStatement.Condition);
       if (assertStatement.Description != null)
     assertStatement.Description = this.Rewrite(assertStatement.Description);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Visits the specified assert statement.
 /// </summary>
 /// <param name="assertStatement">The assert statement.</param>
 public override void Visit(IAssertStatement assertStatement)
 {
     AssertStatement mutableAssertStatement = assertStatement as AssertStatement;
     if (alwaysMakeACopy || mutableAssertStatement == null) mutableAssertStatement = new AssertStatement(assertStatement);
     this.resultStatement = this.myCodeMutator.Visit(mutableAssertStatement);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Visits the specified assert statement.
 /// </summary>
 /// <param name="assertStatement">The assert statement.</param>
 /// <returns></returns>
 public virtual IStatement Visit(AssertStatement assertStatement)
 {
     assertStatement.Condition = this.Visit(assertStatement.Condition);
       return assertStatement;
 }