machine/machine.specifications — pull request #261 by developwithpassion (2014-12-20 00:01:33+00:00)
Title: Pull Request to fix issue #260

Hey everyone,

Been 5 years and I'm now back on a .Net based project :).

Ran into a bug with ContextFactory not being able to correctly handling non trivial nesting of contexts when there is a mixture of Generic Arguments coming from any level of the context hierarchy:

Given the following example context hierarchy:

```c#
[Tags(tag.example)]
public class generic_container
{
public class nested_context
{

}

public class nested_generic_context
{
public class nested_nested_non_generic
{
}

public class nested_nested_generic
{
}
}
}
```

ContextFactory will fail to successfully explore the enclosing types correctly in a variety of scenarios.

I have put in a suite of accompanying tests along with a FIX to the issue. I also did some small refactoring of the "inspection" code that was in ContextFactory. It is now using a parameter object to make the code in the CollectFieldDetails method more manageable.

It looks like the current master branch is only running the NUnit tests from the build script, so I put the tests in both the Machine.Specifications.Specs project as well as the Machine.Specification.Tests project so that NUnit would pick it up. I'm assuming that you are going to be re-tweaking the build to run "all tests".
Develop With Passion®