Skip to content

Commit

Permalink
cqfn#359 use new class
Browse files Browse the repository at this point in the history
  • Loading branch information
akryvtsun committed Jan 3, 2020
1 parent fd7f24c commit c72c134
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions src/test/java/org/jpeek/skeleton/XmlClassTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public final class XmlClassTest {
public void parsesClass() {
new Assertion<>(
"Must parse class",
XhtmlMatchers.xhtml(this.classAsXml("Bar")),
XhtmlMatchers.xhtml(new ClassAsXml("Bar").value()),
XhtmlMatchers.hasXPaths(
"/class/methods[count(method) = 5]",
"/class/attributes[count(attribute) = 4]"
Expand All @@ -58,7 +58,7 @@ public void parsesMethodVisibility() {
new Assertion<>(
"Must parse method visibility",
XhtmlMatchers.xhtml(
this.classAsXml("ClassWithDifferentMethodVisibilities")
new ClassAsXml("ClassWithDifferentMethodVisibilities").value()
),
XhtmlMatchers.hasXPaths(
"/class/methods/method[@visibility = 'public']",
Expand All @@ -74,25 +74,11 @@ public void thereIsNoAttributePublic() {
new Assertion<>(
"attribute public does not exists",
XhtmlMatchers.xhtml(
this.classAsXml("ClassWithDifferentMethodVisibilities")
new ClassAsXml("ClassWithDifferentMethodVisibilities").value()
),
XhtmlMatchers.hasXPaths(
"/class/methods/method[not (@public)]"
)
).affirm();
}

// @todo #297:30min this method appears three times and may be useful for
// future tests, so extract the method as a new class.
private String classAsXml(final String name) {
return new Xembler(
new Directives().add("class").append(
new XmlClass(
new Classes(
new FakeBase(name)
).iterator().next()
)
)
).xmlQuietly();
}
}

0 comments on commit c72c134

Please sign in to comment.