| Index: pkg/unittest/test/matchers_test.dart
|
| ===================================================================
|
| --- pkg/unittest/test/matchers_test.dart (revision 13752)
|
| +++ pkg/unittest/test/matchers_test.dart (working copy)
|
| @@ -23,6 +23,16 @@
|
| add(' ignoring whitespace');
|
| }
|
|
|
| +class Widget {
|
| + int price;
|
| +}
|
| +
|
| +class HasPrice extends FeatureMatcher {
|
| + const HasPrice(matcher) :
|
| + super("Widget with a price that is", "price", matcher);
|
| + featureValueOf(actual) => actual.price;
|
| +}
|
| +
|
| void main() {
|
|
|
| initUtils();
|
| @@ -524,5 +534,16 @@
|
| description: "an instance of String"));
|
| });
|
| });
|
| +
|
| + group('Feature Matchers', () {
|
| + test("Feature Matcher", () {
|
| + var w = new Widget();
|
| + w.price = 10;
|
| + shouldPass(w, new HasPrice(greaterThan(0)));
|
| + shouldFail(w, new HasPrice(greaterThan(10)),
|
| + 'Expected: Widget with a price that is a value greater than <10> '
|
| + 'but: price was <10>.');
|
| + });
|
| + });
|
| }
|
|
|
|
|