assign method

void assign(
  1. Type propertyType,
  2. AsserestTestPlatformBuilder platformBuilder, {
  3. bool replaceIfAssigned = false,
})

Bind platformBuilder with corresponsed propertyType.

Warning

There is no type guard system for verifying propertyType and parameter of platformBuilder. Thus, it cannot be undone after assign is called.

If the incorrect propertyType assigned, the only solution is reset and repeat assign process.

Implementation

void assign(Type propertyType, AsserestTestPlatformBuilder platformBuilder,
    {bool replaceIfAssigned = false}) {
  if (replaceIfAssigned || !isAssigned(propertyType)) {
    _platformBuilders[propertyType] = platformBuilder;
  }
}