{"action":"created","issue":{"url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/issues/648","repository_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy","labels_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/issues/648/labels{/name}","comments_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/issues/648/comments","events_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/issues/648/events","html_url":"https://github.com/FakeItEasy/FakeItEasy/issues/648","id":147434359,"number":648,"title":"Common default return value of functions with generics","user":{"login":"balazsbonis","id":7962460,"avatar_url":"https://avatars.githubusercontent.com/u/7962460?v=3","gravatar_id":"","url":"https://api.github.com/users/balazsbonis","html_url":"https://github.com/balazsbonis","followers_url":"https://api.github.com/users/balazsbonis/followers","following_url":"https://api.github.com/users/balazsbonis/following{/other_user}","gists_url":"https://api.github.com/users/balazsbonis/gists{/gist_id}","starred_url":"https://api.github.com/users/balazsbonis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balazsbonis/subscriptions","organizations_url":"https://api.github.com/users/balazsbonis/orgs","repos_url":"https://api.github.com/users/balazsbonis/repos","events_url":"https://api.github.com/users/balazsbonis/events{/privacy}","received_events_url":"https://api.github.com/users/balazsbonis/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/labels/enhancement","name":"enhancement","color":"02e10c"},{"url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/labels/P2","name":"P2","color":"732787"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2016-04-11T13:42:52Z","updated_at":"2016-04-11T15:37:26Z","closed_at":null,"body":"I am writing unit tests for little tasks that are talking to the database. My test cases also include scenarios where a given object is not found in the database, and therefore I'd like to emulate that the queries return `null`.\r\n\r\nNow, I managed to achieve this by using the following calls:\r\n\r\n```c#\r\nvar _session = // database session\r\nA.CallTo(_session).WithReturnType<Foo>().Returns(null);\r\nA.CallTo(_session).WithReturnType<Bar>().Returns(null);\r\n// ~10 more of these with just different types defined\r\n```\r\n\r\nhowever I was wondering if there is a way of setting this up as the default behaviour - so that all calls to `_session` with a generic parameter will return `null` by default?\r\n\r\nI don't know if it is possible in the first place, but it would probably be a nice feature."},"comment":{"url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/issues/comments/208406026","html_url":"https://github.com/FakeItEasy/FakeItEasy/issues/648#issuecomment-208406026","issue_url":"https://api.github.com/repos/FakeItEasy/FakeItEasy/issues/648","id":208406026,"user":{"login":"adamralph","id":677704,"avatar_url":"https://avatars.githubusercontent.com/u/677704?v=3","gravatar_id":"","url":"https://api.github.com/users/adamralph","html_url":"https://github.com/adamralph","followers_url":"https://api.github.com/users/adamralph/followers","following_url":"https://api.github.com/users/adamralph/following{/other_user}","gists_url":"https://api.github.com/users/adamralph/gists{/gist_id}","starred_url":"https://api.github.com/users/adamralph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamralph/subscriptions","organizations_url":"https://api.github.com/users/adamralph/orgs","repos_url":"https://api.github.com/users/adamralph/repos","events_url":"https://api.github.com/users/adamralph/events{/privacy}","received_events_url":"https://api.github.com/users/adamralph/received_events","type":"User","site_admin":false},"created_at":"2016-04-11T15:37:26Z","updated_at":"2016-04-11T15:37:26Z","body":"What would be the use case for a non-default value? Would it not be covered by `WithReturnType()`?"}}