Dart API ReferenceunittestDescription

Description abstract class

Matchers build up their error messages by appending to Description objects. This interface is implemented by StringDescription. This interface is unlikely to need other implementations, but could be useful to replace in some cases - e.g. language conversion.

abstract class Description {
  /** Change the value of the description. */
  abstract Description replace(String text);

  /** This is used to add arbitrary text to the description. */
  abstract Description add(String text);

  /** This is used to add a meaningful description of a value. */
  abstract Description addDescriptionOf(value);

  /**
   * This is used to add a description of an [Iterable] [list],
   * with appropriate [start] and [end] markers and inter-element [separator].
   */
  abstract Description addAll(String start, String separator, String end,
                     Iterable list);
}

Subclasses

StringDescription

Methods

abstract Description add(String text) #

This is used to add arbitrary text to the description.

abstract Description addAll(String start, String separator, String end, Iterable list) #

This is used to add a description of an [Iterable] [list], with appropriate start and end markers and inter-element separator.

abstract Description addDescriptionOf(value) #

This is used to add a meaningful description of a value.

abstract Description replace(String text) #

Change the value of the description.