GtExample

I represent the concept of an Example. I am constructed out of a method that returns an object. I hold the meta-information about that method and I know how to construct the concrete resulting object that is returned by the method. I can depend on other examples, and other examples can depend on me. When I depend on another example, the code that produces me uses the result of the other example to construct me.

The class for which I represent the example is called my Subject. I can have multiple subjects.

The object on which I am executed is the provider. This is obtained using the provider class. The class that offers the method out of which I am constructed is the method class. The provider class and the method class are not the same in case of inherited examples. For them, the provider class can be a subclass of the method class. In this case the method resides in a superclass and is executed on an instance of the subclass. I also know how to handle possible exceptions, which makes me a great candidate for encoding assumptions that are otherwise expressed as classic tests.