{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"never","basic_auth":false,"params":[],"results":{"codes":[]},"try":true},"next":{"description":"","pages":[]},"title":"Substituting your own fake objects","type":"basic","slug":"substituting-your-own-fake-objects","excerpt":"","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.","updates":[],"order":3,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"54485297c1b42e08005b82ae","project":"54471fc9e12a270800028adc","user":"54471f91beb6320800da6f75","createdAt":"2014-10-23T00:57:59.441Z","githubsync":"","version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["54471fc9e12a270800028ae0","5447b9e7b96a63140077d747","5447be130319802200fc0620","5447ed118d7af31a00dd411c","5447ed230319802200fc0702","5448524c4544c30800241f41","544854504544c30800241f4d","544854af4544c30800241f50","544854e74544c30800241f51","54485557c1b42e08005b82bf"],"_id":"54471fc9e12a270800028adf","__v":10,"project":"54471fc9e12a270800028adc","releaseDate":"2014-10-22T03:08:57.750Z","createdAt":"2014-10-22T03:08:57.750Z"},"__v":1,"category":{"sync":{"isSync":false,"url":""},"pages":["54485265c1b42e08005b82aa","544852774544c30800241f44","544852884544c30800241f46","54485297c1b42e08005b82ae"],"title":"Mocks","slug":"mocks","order":4,"from_sync":false,"reference":false,"_id":"5448524c4544c30800241f41","project":"54471fc9e12a270800028adc","version":"54471fc9e12a270800028adf","__v":4,"createdAt":"2014-10-23T00:56:44.293Z"},"is_link":false}

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.