{"action":"created","issue":{"url":"https://api.github.com/repos/trackabout/speceasy/issues/31","labels_url":"https://api.github.com/repos/trackabout/speceasy/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/trackabout/speceasy/issues/31/comments","events_url":"https://api.github.com/repos/trackabout/speceasy/issues/31/events","html_url":"https://github.com/trackabout/speceasy/pull/31","id":95942162,"number":31,"title":"Support for testing classes with non-public ctors","user":{"login":"appakz","id":139782,"avatar_url":"https://avatars.githubusercontent.com/u/139782?v=3","gravatar_id":"","url":"https://api.github.com/users/appakz","html_url":"https://github.com/appakz","followers_url":"https://api.github.com/users/appakz/followers","following_url":"https://api.github.com/users/appakz/following{/other_user}","gists_url":"https://api.github.com/users/appakz/gists{/gist_id}","starred_url":"https://api.github.com/users/appakz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appakz/subscriptions","organizations_url":"https://api.github.com/users/appakz/orgs","repos_url":"https://api.github.com/users/appakz/repos","events_url":"https://api.github.com/users/appakz/events{/privacy}","received_events_url":"https://api.github.com/users/appakz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-19T19:27:31Z","updated_at":"2015-07-19T19:30:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/trackabout/speceasy/pulls/31","html_url":"https://github.com/trackabout/speceasy/pull/31","diff_url":"https://github.com/trackabout/speceasy/pull/31.diff","patch_url":"https://github.com/trackabout/speceasy/pull/31.patch"},"body":"Howdy SpecEasy-ians.\r\n\r\nWe use a fair bit of internal classes in our projects and often want to have those classes use internal constructors. We've been having issues with the TinyIoC implementation we have embedded into SpecyEasy resolving and creating those SUT instances if the target type has an internal ctor. The issue was that TinyIoC wasn't finding the internal ctors via the reflection calls it was making and therefore just blew  up while trying to build the SUT instance.\r\n\r\nI created an extra class lib in the solution (with the Dumbest Code Ever(tm) in it) with 'InternalsVisibleTo' assembly meta data to repro the issue. As it turns out, the fix appears to be pretty easy. There was some commented out code in the TinyIoC file that was using the newer 'DeclaredConstructors' property that was made available in .NET 4.5, and that property returns ''all'' constructors (not just public ones).  If I were building a general purpose IoC container I'd say that behavior is maybe not always desired, but for the purposes of SpecEasy I'd say that we probably do want to allow for constructing SUT instances using non-public ctors if possible.\r\n\r\nA couple of other notes:\r\n- This change would mean that TinyIoC could resolve SUTs that have private constructors. I'm not sure how I feel about that exactly... I'm open to thoughts or concerns though.\r\n- There was some weirdness with the nUnit package when I first cloned the repo and tried to build it, I was missing refs to nunit.core and nunit.core.interfaces. The .csproj file wanted them to be under /packages/nunit.test.runner (or something like that), but our packages config didn't include that page. I went ahead and included it, and that made things work, but I noticed also bumped the version of those assemblies from 2.6.3.<something> to 2.6.4.<something>. This is only for the SpecEasy.Specs assembly and won't actually impact the Speceasy.dll that we're shipping, so it shouldn't matter but I wanted to mention it.\r\n- I made this change with CTP of Visual Studio 2015, and it tagged the .sln file accordingly. Not sure that we care.\r\n- The SpecEasy.Specs project got a new \"service include={guid}\" node added that apparently is harmless and just used by the built-in VS test runner to know that a certain project contains unit tests.\r\n\r\nLet me know what you think!\r\n"},"comment":{"url":"https://api.github.com/repos/trackabout/speceasy/issues/comments/122697067","html_url":"https://github.com/trackabout/speceasy/pull/31#issuecomment-122697067","issue_url":"https://api.github.com/repos/trackabout/speceasy/issues/31","id":122697067,"user":{"login":"appakz","id":139782,"avatar_url":"https://avatars.githubusercontent.com/u/139782?v=3","gravatar_id":"","url":"https://api.github.com/users/appakz","html_url":"https://github.com/appakz","followers_url":"https://api.github.com/users/appakz/followers","following_url":"https://api.github.com/users/appakz/following{/other_user}","gists_url":"https://api.github.com/users/appakz/gists{/gist_id}","starred_url":"https://api.github.com/users/appakz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appakz/subscriptions","organizations_url":"https://api.github.com/users/appakz/orgs","repos_url":"https://api.github.com/users/appakz/repos","events_url":"https://api.github.com/users/appakz/events{/privacy}","received_events_url":"https://api.github.com/users/appakz/received_events","type":"User","site_admin":false},"created_at":"2015-07-19T19:30:47Z","updated_at":"2015-07-19T19:30:47Z","body":"ping @rockhymas @ronrat"}}