kamagra how much to take

Force Pex To Find Factories In Satellite Pex Assemblies

I am still at my client Pexing out. It’s really neat to explore this whole new framework but honestly I am starting to get a little bored writing nothing but tests, even though Pex makes it a little better.

One problem I ran into when building the tests for my client was Pex was barfing because could not a factory that was located in a satellite Pex assembly. The only way that I could seemingly get it to work was to use to copy the relevant class to the other main Pex assembly, but this is terribly because not having the ambiguous references is pretty bad.

This is fixable however through the use of the assembly level PexExplorableFromFactoriesFromType and PexExplorableFromFactoriesFromAssembly attributes which allow you to specify factory methods to use in a declarative fashion.

This looks like the following:

  1. [assembly: PexExplorableFromFactoriesFromType(typeof(TypeWithFactoryMethod))]

Addition of the above will allow the mining of the appropriate factory methods.

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>