plioi/fixie — pull request #73 by plioi (2014-12-18 16:40:22+00:00)
Title: Allow convention authors to construct their own behavior instances.

For a while now, convention authors have been able to customize test execution behavior by supplying the names of their custom behavior types. For instance, the [NUnit immitation sample](https://github.com/plioi/fixie/blob/master/src/Fixie.Samples/NUnitStyle/CustomConvention.cs) specifies support of NUnit-style lifecycle attributes like so:

```cs
FixtureExecution
.Wrap();

CaseExecution
.Wrap();
```

The named behavior types are defined nearby:

```cs
class SetUpTearDown : CaseBehavior
{
public void Execute(Case @case, Action next)
{
@case.Class.InvokeAll(@case.Fixture.Instance);
next();
@case.Class.InvokeAll(@case.Fixture.Instance);
}
}

class FixtureSetUpTearDown : FixtureBehavior
{
public void Execute(Fixture fixture, Action next)
{
fixture.Class.Type.InvokeAll(fixture.Instance);
next();
fixture.Class.Type.InvokeAll(fixture.Instance);
}
}
```

Since Fixie was only allowing type names to specify custom behaviors, and therefore owned construction of those behaviors by calling the default constructor, there was no natural way to pass anything more into the custom behavior classes, such as a reference to your prepared IoC container.

This pull request adds overloads for the .Wrap methods, allowing a pre-constructed behavior instance to be provided instead:

```cs
ClassExecution
.Wrap(new ClassSetUpTearDown(...));

FixtureExecution
.Wrap(new FixtureSetUpTearDown(...));

CaseExecution
.Wrap(new SetUpTearDown(...));
```