{"_id":"54485297c1b42e08005b82ae","project":"54471fc9e12a270800028adc","user":"54471f91beb6320800da6f75","version":{"_id":"54471fc9e12a270800028adf","__v":10,"project":"54471fc9e12a270800028adc","createdAt":"2014-10-22T03:08:57.750Z","releaseDate":"2014-10-22T03:08:57.750Z","categories":["54471fc9e12a270800028ae0","5447b9e7b96a63140077d747","5447be130319802200fc0620","5447ed118d7af31a00dd411c","5447ed230319802200fc0702","5448524c4544c30800241f41","544854504544c30800241f4d","544854af4544c30800241f50","544854e74544c30800241f51","54485557c1b42e08005b82bf"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"__v":1,"category":{"_id":"5448524c4544c30800241f41","project":"54471fc9e12a270800028adc","version":"54471fc9e12a270800028adf","__v":4,"pages":["54485265c1b42e08005b82aa","544852774544c30800241f44","544852884544c30800241f46","54485297c1b42e08005b82ae"],"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-10-23T00:56:44.293Z","from_sync":false,"order":4,"slug":"mocks","title":"Mocks"},"is_link":false,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2014-10-23T00:57:59.441Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"basic_auth":false,"results":{"codes":[]},"try":true,"auth":"never","params":[],"url":""},"isReference":false,"order":3,"body":"Sometimes you don't want SpecsFor to create a mock object for you.  Instead, you may wish for SpecsFor to inject your own custom fake object instead.  You can do this by [registering a concrete type in the auto-mocking container](doc:register-a-concrete-type-in-the-auto-mocking-conta).  \n\nNote that you will *NOT* be able to retrieve an instance of your fake object using the standard GetMockFor<T> helper method.  Instead, you will need to access the underlying auto-mocking container directly.  This container is exposed in the MockContainer property of the base SpecsFor class.","excerpt":"","slug":"substituting-your-own-fake-objects","type":"basic","title":"Substituting your own fake objects"}

Substituting your own fake objects


Sometimes you don't want SpecsFor to create a mock object for you. Instead, you may wish for SpecsFor to inject your own custom fake object instead. You can do this by [registering a concrete type in the auto-mocking container](doc:register-a-concrete-type-in-the-auto-mocking-conta). Note that you will *NOT* be able to retrieve an instance of your fake object using the standard GetMockFor<T> helper method. Instead, you will need to access the underlying auto-mocking container directly. This container is exposed in the MockContainer property of the base SpecsFor class.