Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add back factory option to instanciate ParameterSource #61

Closed
pedroreys opened this issue Dec 1, 2014 · 1 comment
Closed

Add back factory option to instanciate ParameterSource #61

pedroreys opened this issue Dec 1, 2014 · 1 comment

Comments

@pedroreys
Copy link
Contributor

Hey Patrick,

I'm resolving the Test Method parameters using a combination of AutoFixture and an IoC Container.
To make this work, I need to be able to customize an AutoFixture instance, to include among other things, my customization that uses the IoC container to create the requested instance.

In previous versions of Fixie I was able to do this using the Func<> based method to fill the test methods parameters. But now, I can only add ParameterSource type, that Fixie then instanciate by itself. The problem is that now I lost the ability to inject my customized object factory.

Is it possible to add back the Func<> based api to define a parameter source?

@plioi
Copy link
Contributor

plioi commented Dec 18, 2014

This should be fixed in 0.0.1.229.

When I switched from lambda-based to Type-based customization of the many .Wrap(...) methods and Parameter Sources, I did it in a way that forced me to stop supporting the lambda alternatives. Today, I realized how to finally support both. .Wrap(...) and ParameterSource.Add(...) now all come in three flavors:

Parameters
     .Add<MyTypeName>();

Parameters
     .Add(new MyTypeName()); //Meaning your constructors could now take in arguments.

Parameters
    .Add(method => {
         //return zero or more object[ ] arrays.
    });

@plioi plioi closed this as completed Dec 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants