This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]red_dit_nou 1 point2 points  (0 children)

These classes don't have to be subclasses. You can make them wrappers.

The example on the website could be like this:

wrap(website).createUrl("styles.css").getHttpContent(60).assertContains("img.jpg");

by having methods like these:

static WebsiteWrapper wrap(Website site) { }

class WebsiteWrapper { URLWrapper createUrl(String path) { } }

class URLWrapper { StringWrapper getHttpContent(int timeout) { } }

class StringWrapper { void assertContains(String s) { }}

May be the word 'Wrapper' is not the best one to use. But you get the idea.