{"action":"created","issue":{"url":"https://api.github.com/repos/techtalk/SpecFlow/issues/600","repository_url":"https://api.github.com/repos/techtalk/SpecFlow","labels_url":"https://api.github.com/repos/techtalk/SpecFlow/issues/600/labels{/name}","comments_url":"https://api.github.com/repos/techtalk/SpecFlow/issues/600/comments","events_url":"https://api.github.com/repos/techtalk/SpecFlow/issues/600/events","html_url":"https://github.com/techtalk/SpecFlow/pull/600","id":153010468,"number":600,"title":"Added Changes to Allow for Mbunit Framework to run Scenarios in parallel ","user":{"login":"tmulkern","id":8748428,"avatar_url":"https://avatars.githubusercontent.com/u/8748428?v=3","gravatar_id":"","url":"https://api.github.com/users/tmulkern","html_url":"https://github.com/tmulkern","followers_url":"https://api.github.com/users/tmulkern/followers","following_url":"https://api.github.com/users/tmulkern/following{/other_user}","gists_url":"https://api.github.com/users/tmulkern/gists{/gist_id}","starred_url":"https://api.github.com/users/tmulkern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmulkern/subscriptions","organizations_url":"https://api.github.com/users/tmulkern/orgs","repos_url":"https://api.github.com/users/tmulkern/repos","events_url":"https://api.github.com/users/tmulkern/events{/privacy}","received_events_url":"https://api.github.com/users/tmulkern/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/techtalk/SpecFlow/labels/Yellow","name":"Yellow","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2016-05-04T13:22:00Z","updated_at":"2016-05-10T15:13:07Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/techtalk/SpecFlow/pulls/600","html_url":"https://github.com/techtalk/SpecFlow/pull/600","diff_url":"https://github.com/techtalk/SpecFlow/pull/600.diff","patch_url":"https://github.com/techtalk/SpecFlow/pull/600.patch"},"body":"# Added Changes to Allow for Mbunit Framework to run Scenarios in parallel \r\n\r\n## Background\r\n\r\nMbUnit has the ability to run Test Fixtures and Tests in Parallel. When a Test Fixture is set to run in Parallel it runs in a new Thread. When the Test is set to run in Parallel it runs in a new Thread. \r\n\r\n## Changes to `IContextManager.cs`\r\n\r\n- I moved InternalContextManager and StackedInternalContextManager, into separate classes and changed their signature from private to internal\r\n- I created a new interface `IInternalContextManager` and changed to ContextManager constructor to take and instance of `IInternalContextManager<FeatureContext>`, `IInternalContextManager<ScenarioContext>`,`IInternalContextManager<ScenarioStepContext>` therefore leaving Dependency Injection to set the concrete implementation.\r\n\r\n## Added `ThreadSafeInternalContextManagerWrapper.cs`\r\n\r\nThis class allows any of the concrete implementation of `IInternalContextManager` to be wrapped in a thread-safe implementation.\r\n\r\n## Changes to `IUnitTestRuntimeProvider.cs`\r\n\r\nAdded `RegisterContextManager` method, to register the `IInternalContextManager` implementations for each of the Unit Test Providers in the `IObjectContainer`\r\n\r\n## Changes to `TestRunContainerBuilder.cs`\r\n\r\nCalled `RegisterContextManager` for the loaded `IUnitTestRuntimeProvider.cs`\r\n\r\n## Added Tag called `Parallelizable`\r\n\r\n To mark a Feature or Scenario as Parallelizable and added the Parallelizable Attribute in the generated code\r\n\r\n## Added Assorted Tests\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/techtalk/SpecFlow/issues/comments/218189254","html_url":"https://github.com/techtalk/SpecFlow/pull/600#issuecomment-218189254","issue_url":"https://api.github.com/repos/techtalk/SpecFlow/issues/600","id":218189254,"user":{"login":"samholder","id":2073290,"avatar_url":"https://avatars.githubusercontent.com/u/2073290?v=3","gravatar_id":"","url":"https://api.github.com/users/samholder","html_url":"https://github.com/samholder","followers_url":"https://api.github.com/users/samholder/followers","following_url":"https://api.github.com/users/samholder/following{/other_user}","gists_url":"https://api.github.com/users/samholder/gists{/gist_id}","starred_url":"https://api.github.com/users/samholder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samholder/subscriptions","organizations_url":"https://api.github.com/users/samholder/orgs","repos_url":"https://api.github.com/users/samholder/repos","events_url":"https://api.github.com/users/samholder/events{/privacy}","received_events_url":"https://api.github.com/users/samholder/received_events","type":"User","site_admin":false},"created_at":"2016-05-10T15:13:07Z","updated_at":"2016-05-10T15:13:07Z","body":"Maybe I'm misunderstanding something, but I think you can't use `ScenarioContext.Current`, but you can use the `ScenarioContext` as long as you inject it into the class containing the steps. I believe specflow will ensure that each test gets its own instance of the `ScenarioContext`.\r\n\r\nIf Row tests are the issue then I think you can disable rowtests via config (or it could be disabled in the unittest generator for mbunit). Row tests should not be used anyway IMHO as they cause issues with navigation between the tests and the feature files and with knowing which lines started the tests, and as the tests are generated you don't really get any of the benefits as specflow is doing the heavy lifting for you anyway.\r\n\r\nAgain, maybe I don't fully understand the issue and this information may be moot."}}