getBehaviorDrivenDescription method

  1. @override
String getBehaviorDrivenDescription(
  1. TestController tester
)
override

Gets the most appropriate BDD string based on the values set on the step.

Implementation

@override
String getBehaviorDrivenDescription(TestController tester) {
  String result;

  if (timeout == null) {
    if (value == null) {
      result = behaviorDrivenDescriptions[1];
    } else {
      result = behaviorDrivenDescriptions[3];
    }
  } else {
    if (value == null) {
      result = behaviorDrivenDescriptions[0];
    } else {
      result = behaviorDrivenDescriptions[2];
    }
    result = result.replaceAll(
      '{{timeout}}',
      timeout!.inSeconds.toString(),
    );
  }

  result = result.replaceAll('{{testableId}}', testableId);
  result = result.replaceAll('{{type}}', type);
  result = result.replaceAll('{{value}}', value ?? 'null');

  return result;
}