testData<T extends Object> method

T testData<T extends Object>(
  1. dynamic testDataId
)

Looks up the test data defined in your test_data.dart file for a particular test data id.

Implementation

T testData<T extends Object>(dynamic testDataId) {
  final value = registry.find(testDataId);
  if(value == null) {
    throw AFException("Missing test value for id $testDataId");
  }
  if(value is! T) {
    throw AFException("Test value with id $testDataId had type ${value.runtimeType.toString()} when ${T.toString()} was required.");
  }
  return value;
}