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
 private void AddAssertion(IExpression condition)
 {
     AssertStatement assertStatement = new AssertStatement();
       assertStatement.Condition = condition;
       this.GetOrCreateStmtListForStmt(this.currentStatement).Add(assertStatement);
 }
Exemple #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;
 }
Exemple #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);
 }
Exemple #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);
 }
Exemple #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);
 }
Exemple #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;
 }