kind of new to autofixture. I am trying it out on a mvc web api controller. I have the dependencies being filled by the container (structuremap) as I step through I see the constructor of the apicontroller run and exit then I hit my ContainerSpecimenBuilder ( where structuremap provides instances ) and it's looking for the HttpContent which of course I don't have in my container. I've never even heard of HttpContent before. I'm thinking that i'll just put a filter on the ContainerSpecBuilder. That seems a bit like a hack but it's all I got right now.
EDIT
So I put a filter on my ContainerSpecBuilder if !type.IsInterface ( since I really only ever inject interfaces ) and it fell through but I get the same error except that it says autofixture can't create an HttpContent.
EDIT again
Ok so I created a FakeHttpContentSpecBuilder and that has gotten me past that problem but now i'm getting all sorts of grief from other aspects of the apicontroller. First the IDependencyResolver, now the IHttpRouteData. It seems to me that either my container is not working (although it's setup exactly the same as production) or there is a lot more to having autofixture create an instance of an ApiController than I expected.
I will keep adding my experience here and if anyone is interested in my solutions (hacks) than let me know and I will post them.
And Edit again
So I removed a bunch of classes that I had here and put them all ( a little bit more concisely ) in a GIST here.
the error I get is
StructureMap.StructureMapException: StructureMap Exception Code: 202 No Default Instance defined for PluginFamily System.Web.Http.Dependencies.IDependencyResolver, System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
which essentially means that SM can't find an IDependency in it's container. However, this code actually runs just fine outside of this test so I find that to be erroneous. Further if I add the IDependency declaration in my SM Registry it just moves on to through to another infrastructure error IhttpRouteData I think.
This seems fairly involved, I have no investment in any of this other than that I want my container to supply dependencies to objects in the constructor. if there is an easier way I'm happy to use it.
That's pretty much what I have
R