asserestHttpSetup function

void asserestHttpSetup({
  1. bool counter = false,
  2. bool handleRedirect = true,
})

Quick setup method for automatically binding HttpPropertyParseProcessor and AsserestHttpTestPlatform into AsserestPropertyParser and AsserestTestAssigner respectively.

This method must be callel at ONCE only, calling multiple time will throw StateError to prevent duplicated input, even though you have been removed those PropertyParseProcessor and AsserestTestPlatform already.

Implementation

void asserestHttpSetup({bool counter = false, bool handleRedirect = true}) {
  if (_asserestHttpSetup) {
    throw StateError(
        "This method should be call once only. If you removed property parse processor or test platform, please add them manually.");
  }

  _asserestHttpSetup = true;
  AsserestPropertyParser().define(HttpPropertyParseProcessor());
  AsserestTestAssigner().assign(
      AsserestHttpProperty,
      (property) => AsserestHttpTestPlatform(property as AsserestHttpProperty,
          counter: counter, handleRedirect: handleRedirect));
}