{"action":"created","issue":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/761","labels_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/761/labels{/name}","comments_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/761/comments","events_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/761/events","html_url":"https://github.com/AutoMapper/AutoMapper/issues/761","id":92469913,"number":761,"title":"ResolutionContext needs to be DI friendly","user":{"login":"hosadoya","id":12090183,"avatar_url":"https://avatars.githubusercontent.com/u/12090183?v=3","gravatar_id":"","url":"https://api.github.com/users/hosadoya","html_url":"https://github.com/hosadoya","followers_url":"https://api.github.com/users/hosadoya/followers","following_url":"https://api.github.com/users/hosadoya/following{/other_user}","gists_url":"https://api.github.com/users/hosadoya/gists{/gist_id}","starred_url":"https://api.github.com/users/hosadoya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hosadoya/subscriptions","organizations_url":"https://api.github.com/users/hosadoya/orgs","repos_url":"https://api.github.com/users/hosadoya/repos","events_url":"https://api.github.com/users/hosadoya/events{/privacy}","received_events_url":"https://api.github.com/users/hosadoya/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-01T19:46:04Z","updated_at":"2015-07-01T19:52:20Z","closed_at":null,"body":"In order to unit test converters in isolation, currently we have to construct real ResolutionContext object instead of being able to mock one, and register and use the Mapper. This forces us to test more than what we need to test (the converter).\r\n\r\nCan we have ResolutionContext inherit an interface IResolutionContext to comply with DIP (Dependency Inversion Principle)?\r\n\r\nEither of those options should work:\r\n\r\nOption 1:\r\ninterface IResolutionContext : IEquatable&lt;IResolutionContext&gt;\r\nclass ResolutionContext : IResolutionContext\r\n\r\nOption 2: (this is preferred since it complies with ISP (Interface Segregation Principle))\r\ninterface IResolutionContext\r\nclass ResolutionContext : IResolutionContext, IEquatable&lt;IResolutionContext&gt;\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/comments/117806395","html_url":"https://github.com/AutoMapper/AutoMapper/issues/761#issuecomment-117806395","issue_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/761","id":117806395,"user":{"login":"jbogard","id":104498,"avatar_url":"https://avatars.githubusercontent.com/u/104498?v=3","gravatar_id":"","url":"https://api.github.com/users/jbogard","html_url":"https://github.com/jbogard","followers_url":"https://api.github.com/users/jbogard/followers","following_url":"https://api.github.com/users/jbogard/following{/other_user}","gists_url":"https://api.github.com/users/jbogard/gists{/gist_id}","starred_url":"https://api.github.com/users/jbogard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbogard/subscriptions","organizations_url":"https://api.github.com/users/jbogard/orgs","repos_url":"https://api.github.com/users/jbogard/repos","events_url":"https://api.github.com/users/jbogard/events{/privacy}","received_events_url":"https://api.github.com/users/jbogard/received_events","type":"User","site_admin":false},"created_at":"2015-07-01T19:52:20Z","updated_at":"2015-07-01T19:52:20Z","body":"Mock resolution context? It's a value object, you don't mock it. It's like mocking `string` or `int` or `Tuple`. It's not a service, it just holds data. You should just \"new\" it up and use that."}}