BloomMock class abstract

Base class for Bloom service test doubles with call recording utilities.

Subclass this in your test suites to track method invocations and arguments without third-party mocking libraries.

Example:

class MockAnalyticsService extends BloomMock {
  void track(String event) {
    recordCall('track');
  }
}

Constructors

BloomMock()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getCallCount(String methodName) int
Returns the number of times methodName was invoked.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
recordCall(String methodName) → void
Records a call invocation for the specified methodName.
resetMockCalls() → void
Clears all recorded method call counts.
toString() String
A string representation of this object.
inherited
wasCalled(String methodName) bool
Returns whether methodName was called at least once.

Operators

operator ==(Object other) bool
The equality operator.
inherited