define<TData> method

TData define<TData>(
  1. dynamic id,
  2. TData data
)

Associates the test data id id with the value data, and returns the data for further use.

The data can later be located using the find method, and can be referenced directly using the ID from a variety of AFib test contexts.

Implementation

TData define<TData>(dynamic id, TData data) {
  if(testData.containsKey(id)) {
    assert(false, "You should not redefine a of the existing id $id in the test data");
  }
  testData[id] = data;
  return data;
}