{"action":"opened","issue":{"url":"https://api.github.com/repos/Excel-DNA/ExcelDna/issues/21","labels_url":"https://api.github.com/repos/Excel-DNA/ExcelDna/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/Excel-DNA/ExcelDna/issues/21/comments","events_url":"https://api.github.com/repos/Excel-DNA/ExcelDna/issues/21/events","html_url":"https://github.com/Excel-DNA/ExcelDna/issues/21","id":103822089,"number":21,"title":"Add support for unit testing in Excel-DNA","user":{"login":"CaioProiete","id":177608,"avatar_url":"https://avatars.githubusercontent.com/u/177608?v=3","gravatar_id":"","url":"https://api.github.com/users/CaioProiete","html_url":"https://github.com/CaioProiete","followers_url":"https://api.github.com/users/CaioProiete/followers","following_url":"https://api.github.com/users/CaioProiete/following{/other_user}","gists_url":"https://api.github.com/users/CaioProiete/gists{/gist_id}","starred_url":"https://api.github.com/users/CaioProiete/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CaioProiete/subscriptions","organizations_url":"https://api.github.com/users/CaioProiete/orgs","repos_url":"https://api.github.com/users/CaioProiete/repos","events_url":"https://api.github.com/users/CaioProiete/events{/privacy}","received_events_url":"https://api.github.com/users/CaioProiete/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-29T02:11:07Z","updated_at":"2015-08-29T02:11:07Z","closed_at":null,"body":"Currently it is not possible to unit test Excel add-ins built with Excel DNA, because pretty all iterations one does with the Excel DNA framework requires calling methods in static classes, which in turn try to call Excel APIs/features and because these are static classes, it is not possible to mock these classes.\r\n\r\nI've made a good process with my [Excel DNA Wrapper](https://github.com/CaioProiete/Excel-DNA-Wrapper) project which addresses many of these issues, but it is not ideal and it is harder to maintain as Excel DNA moves and new methods are added.\r\n\r\nI'd like all static classes that relies on Excel functionality to be implemented as regular classes that also implement interfaces (so that we can depend on these interfaces instead, and be able to mock) and then mark the static classes `Obsolete`, to encourage devs to use the new regular classes/interfaces."}}