{"action":"closed","issue":{"url":"https://api.github.com/repos/adamdriscoll/poshtools/issues/407","repository_url":"https://api.github.com/repos/adamdriscoll/poshtools","labels_url":"https://api.github.com/repos/adamdriscoll/poshtools/issues/407/labels{/name}","comments_url":"https://api.github.com/repos/adamdriscoll/poshtools/issues/407/comments","events_url":"https://api.github.com/repos/adamdriscoll/poshtools/issues/407/events","html_url":"https://github.com/adamdriscoll/poshtools/issues/407","id":132620920,"number":407,"title":"Exception when using PowerShellTestAdapter with VSTest","user":{"login":"thomas-worm-datev","id":17155850,"avatar_url":"https://avatars.githubusercontent.com/u/17155850?v=3","gravatar_id":"","url":"https://api.github.com/users/thomas-worm-datev","html_url":"https://github.com/thomas-worm-datev","followers_url":"https://api.github.com/users/thomas-worm-datev/followers","following_url":"https://api.github.com/users/thomas-worm-datev/following{/other_user}","gists_url":"https://api.github.com/users/thomas-worm-datev/gists{/gist_id}","starred_url":"https://api.github.com/users/thomas-worm-datev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomas-worm-datev/subscriptions","organizations_url":"https://api.github.com/users/thomas-worm-datev/orgs","repos_url":"https://api.github.com/users/thomas-worm-datev/repos","events_url":"https://api.github.com/users/thomas-worm-datev/events{/privacy}","received_events_url":"https://api.github.com/users/thomas-worm-datev/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-10T06:39:14Z","updated_at":"2016-02-10T06:50:18Z","closed_at":"2016-02-10T06:50:18Z","body":"Using The PowerShellTestAdapter with vstest.console.exe Tests are crashing because TestRunDirectory is null in test context.\r\n\r\nArgument must not be NULL.\r\nParametername: path1\r\n   bei System.IO.Path.Combine(String path1, String path2)\r\n   bei PowerShellTools.TestAdapter.PowerShellTestExecutor.GetModulePath(String moduleName, String root)\r\n   bei PowerShellTools.TestAdapter.PowerShellTestExecutor.FindModule(String moduleName, IRunContext runContext)\r\n   bei PowerShellTools.TestAdapter.PowerShellTestExecutor.RunTest(PowerShell powerShell, TestCase testCase, IRunContext runContext)\r\n   bei PowerShellTools.TestAdapter.PowerShellTes\r\n\r\nThen\r\n`var pesterPath = GetModulePath(moduleName, runContext.TestRunDirectory);`\r\nis calling\r\n`private static string GetModulePath(string moduleName, string root)`\r\nwith root = NULL\r\n\r\nThis will lead\r\n`var packagesRoot = Path.Combine(root, \"packages\");`\r\nto an ArgumentNullException.\r\n\r\n\r\nGetModulePath should check if root is NULL and return NULL in this case.\r\n\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/30711546-exception-when-using-powershelltestadapter-with-vstest?utm_campaign=plugin&utm_content=tracker%2F307202&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F307202&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"}}