SharedProvider
A Shared is a lazily-created value that is reused between tests.
Most of the time, PreparedProvider should be preferred to this class. To learn why, see Shared.
Although SharedProvider is conceptually equivalent to PreparedProvider, and can be used to generate multiple Shared instances from the same block in exactly the same way, this is not recommended.
Shared values should only be used when all of these are true:
The generated value is immutable,
The generated value is too expensive to compute each test,
The generation of this value does not involve side effects which may change the output of a test.
If these conditions are met, then generating multiple values from the same SharedProvider makes no sense, as it will necessarily return the same value.
This class exists because of its other use-case: capturing the name of the property it is instantiated to, using the by
keyword. See shared and provideDelegate.