Index: tests/html/svgelement_test.dart |
=================================================================== |
--- tests/html/svgelement_test.dart (revision 14114) |
+++ tests/html/svgelement_test.dart (working copy) |
@@ -25,9 +25,9 @@ |
testConstructor(String tagName, Function isExpectedClass) { |
test(tagName, () { |
- Expect.isTrue(isExpectedClass(new SVGElement.tag(tagName))); |
- Expect.isTrue(isExpectedClass( |
- new SVGElement.svg('<$tagName></$tagName>'))); |
+ expect(isExpectedClass(new SVGElement.tag(tagName)), isTrue); |
+ expect(isExpectedClass( |
+ new SVGElement.svg('<$tagName></$tagName>')), isTrue); |
}); |
} |
@@ -40,23 +40,22 @@ |
<path></path> |
</svg>"""; |
final el = new SVGElement.svg(svg); |
- Expect.isTrue(el is SVGSVGElement); |
- Expect.equals("<circle></circle><path></path>", el.innerHTML); |
- Expect.equals(svg, el.outerHTML); |
+ expect(el, new isInstanceOf<SVGSVGElement>('SVGSVGElement')); |
+ expect(el.innerHTML, "<circle></circle><path></path>"); |
+ expect(el.outerHTML, svg); |
}); |
test('has no parent', () => |
- Expect.isNull(new SVGElement.svg('<circle/>').parent)); |
+ expect(new SVGElement.svg('<circle/>').parent, isNull) |
+ ); |
test('empty', () { |
- Expect.throws(() => new SVGElement.svg(""), |
- (e) => e is ArgumentError); |
+ expect(() => new SVGElement.svg(""), throwsArgumentError); |
}); |
test('too many elements', () { |
- Expect.throws( |
- () => new SVGElement.svg("<circle></circle><path></path>"), |
- (e) => e is ArgumentError); |
+ expect(() => new SVGElement.svg("<circle></circle><path></path>"), |
+ throwsArgumentError); |
}); |
}); |
@@ -149,8 +148,8 @@ |
final el = new SVGSVGElement(); |
el.elements.add(new SVGElement.tag("circle")); |
el.elements.add(new SVGElement.tag("path")); |
- Expect.equals('<svg version="1.1"><circle></circle><path></path></svg>', |
- el.outerHTML); |
+ expect(el.outerHTML, |
+ '<svg version="1.1"><circle></circle><path></path></svg>'); |
}); |
group('innerHTML', () { |
@@ -158,7 +157,7 @@ |
final el = new SVGSVGElement(); |
el.elements.add(new SVGElement.tag("circle")); |
el.elements.add(new SVGElement.tag("path")); |
- Expect.equals('<circle></circle><path></path>', el.innerHTML); |
+ expect(el.innerHTML, '<circle></circle><path></path>'); |
}); |
test('set', () { |
@@ -166,7 +165,7 @@ |
el.elements.add(new SVGElement.tag("circle")); |
el.elements.add(new SVGElement.tag("path")); |
el.innerHTML = '<rect></rect><a></a>'; |
- Expect.listEquals(["rect", "a"], _nodeStrings(el.elements)); |
+ expect(_nodeStrings(el.elements), ["rect", "a"]); |
}); |
}); |
@@ -178,13 +177,13 @@ |
<path></path> |
text |
</svg>"""); |
- Expect.listEquals(["circle", "path"], _nodeStrings(el.elements)); |
+ expect(_nodeStrings(el.elements), ["circle", "path"]); |
}); |
test('set', () { |
final el = new SVGSVGElement(); |
el.elements = [new SVGElement.tag("circle"), new SVGElement.tag("path")]; |
- Expect.equals('<circle></circle><path></path>', el.innerHTML); |
+ expect(el.innerHTML, '<circle></circle><path></path>'); |
}); |
}); |
} |