ExpectationCounter
Date: 2015-09-15

org.jmock.expectation

## Class ExpectationCounter

- java.lang.Object
- - org.jmock.expectation.AbstractExpectation
  - - org.jmock.expectation.ExpectationCounter

- All Implemented Interfaces:
    Verifiable, Expectation

      public class ExpectationCounter
      extends AbstractExpectation

- - ### Field Summary

    - ### Fields inherited from class org.jmock.expectation.AbstractExpectation

      `myFailureModeIsImmediate, myName`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExpectationCounter(java.lang.String name)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clearActual()`
    `void` | `inc()`
    `void` | `setExpected(int expectedCalls)`
    `void` | `setExpectNothing()` Tell the object to expect nothing to happen to it, perhaps because the test is exercising the handling of an error.
    `void` | `verify()` Throw an AssertionFailedException if any expectations have not been met.

    - ### Methods inherited from class org.jmock.expectation.AbstractExpectation

      `assertEquals, assertEquals, hasExpectations, setFailOnVerify, setHasExpectations, shouldCheckImmediately`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ExpectationCounter

          public ExpectationCounter(java.lang.String name)

  - ### Method Detail

    - #### clearActual

          public void clearActual()

      Specified by:
        `clearActual` in class `AbstractExpectation`

    - #### inc

          public void inc()

    - #### setExpected

          public void setExpected(int expectedCalls)

    - #### setExpectNothing

          public void setExpectNothing()

      Description copied from interface: `Expectation`
      Tell the object to expect nothing to happen to it, perhaps because the test is exercising the handling of an error. The Expectation will fail if any actual values are set.

      Note that this is not the same as not setting any expectations, in which case verify() will do nothing.

    - #### verify

          public void verify()

      Description copied from interface: `Verifiable`
      Throw an AssertionFailedException if any expectations have not been met. Implementations of this method must be idempotent: jMock can call this method more than once when verifying expectations at the end of a test.
      Specified by:
        `verify` in interface `Verifiable`
      Specified by:
        `verify` in class `AbstractExpectation`