Package: groovy.mock.interceptor

## [Groovy] Class LooseExpectation

- groovy.mock.interceptor.LooseExpectation

-     class LooseExpectation
      extends Object

  Expects demanded call cardinalities to match demanded ranges. The calls are allowed to be out of the recorded sequence. If a method is demanded multiple times, the ranges are filled by order of recording.

  See Also:
    StrictExpectation

- - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `List` | `fCalls` Per-demand invocation counters used during verification.
    `Demand` | `fDemand` Demand definition being matched.

  - ### Constructor Summary

    Constructors
    Constructor and description
    `LooseExpectation(Demand demand)` Creates a loose expectation backed by the supplied demand definition.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `boolean` | `isEligible(String name, int i)` Determines whether the recorded demand at the supplied index can satisfy the current call.
    `` | `Closure` | `match(String name)` Match the requested method name against eligible demands.
    `` | `void` | `verify()` verify all calls are in expected range

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Property Detail

    - #### List fCalls

      Per-demand invocation counters used during verification.

    - #### Demand fDemand

      Demand definition being matched.

  - ### Constructor Detail

    - #### LooseExpectation(Demand demand)

      Creates a loose expectation backed by the supplied demand definition.

      Parameters:
        `demand` - the recorded demand specification

  - ### Method Detail

    - #### boolean isEligible(String name, int i)

      Determines whether the recorded demand at the supplied index can satisfy the current call.

      Parameters:
        `name` - the requested method name
        `i` - the index of the candidate demand
      Returns:
        `true` when the demand matches and remains within its allowed range

    - #### Closure match(String name)

      Match the requested method name against eligible demands. Fail early if no match possible. Return the demand's behavior closure on match. Also skips over names matching ignore filter, if any.

    - #### void verify()

      verify all calls are in expected range