TestHelpersTestClock class final
TestClock
A test clock enables deterministic control over objects in testmode. With a test clock, you can create objects at a frozen time in the past or future, and advance to a specific future time to observe webhooks and state changes. After the clock advances, you can either validate the current state of your scenario (and test your assumptions), change the current state of your scenario (and test more complex scenarios), or keep advancing forward in time.
- Implemented types
Constructors
- TestHelpersTestClock({required DateTime created, required DateTime deletesAfter, required DateTime frozenTime, required String id, required bool livemode, String? name, required TestHelpersTestClockStatus status})
-
TestClock
const
- TestHelpersTestClock.fromJson(Object? json)
-
factory
Properties
- created → DateTime
-
final
- deletesAfter → DateTime
-
final
- frozenTime → DateTime
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
The ID of the TestHelpersTestClock.
final
- livemode → bool
-
final
- name → String?
-
final
- object → String
-
The resource's type.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → TestHelpersTestClockStatus
-
final
Methods
-
encodeWith<
V> (Encoder< V> encoder) → V -
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, Object?> -
override
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
encode<
V> (TestHelpersTestClock instance, Encoder< V> encoder) → V -
override