{"action":"opened","issue":{"url":"https://api.github.com/repos/nsubstitute/NSubstitute/issues/233","repository_url":"https://api.github.com/repos/nsubstitute/NSubstitute","labels_url":"https://api.github.com/repos/nsubstitute/NSubstitute/issues/233/labels{/name}","comments_url":"https://api.github.com/repos/nsubstitute/NSubstitute/issues/233/comments","events_url":"https://api.github.com/repos/nsubstitute/NSubstitute/issues/233/events","html_url":"https://github.com/nsubstitute/NSubstitute/issues/233","id":159158810,"number":233,"title":"Disabling Auto Values","user":{"login":"mbordogna","id":16339232,"avatar_url":"https://avatars.githubusercontent.com/u/16339232?v=3","gravatar_id":"","url":"https://api.github.com/users/mbordogna","html_url":"https://github.com/mbordogna","followers_url":"https://api.github.com/users/mbordogna/followers","following_url":"https://api.github.com/users/mbordogna/following{/other_user}","gists_url":"https://api.github.com/users/mbordogna/gists{/gist_id}","starred_url":"https://api.github.com/users/mbordogna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbordogna/subscriptions","organizations_url":"https://api.github.com/users/mbordogna/orgs","repos_url":"https://api.github.com/users/mbordogna/repos","events_url":"https://api.github.com/users/mbordogna/events{/privacy}","received_events_url":"https://api.github.com/users/mbordogna/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-08T13:06:27Z","updated_at":"2016-06-08T13:06:27Z","closed_at":null,"body":"It would be nice to have auto values disabled. I ran into a scenario for casting that was failing with the auto value, it took a bit for us to figure out this was due to a chain that was automatically created due to missing mocks because of the auto value and proxy in a service locator pattern due to differences in registration and the more generalized super interface. \r\n\r\nIf null was returned from the unmocked method, it would have been more obvious. There has been a few other times where this has been the case but when using nSubsitute to fill in the gaps with DI container testing for service locator patterns utilized for complex factories, having auto values made the issue less obvious. \r\n\r\nSo I am proposing an option for disabling auto values, either at construction or as a global setting. Like a ForExpicitMocks<T> method, so that when used it will know to return null for anyting not mocked and does not attempt to create proxies."}}
{"actor":{"display_login":"mbordogna"}}