{"action":"created","issue":{"url":"https://api.github.com/repos/mattflo/NSpec/issues/83","labels_url":"https://api.github.com/repos/mattflo/NSpec/issues/83/labels{/name}","comments_url":"https://api.github.com/repos/mattflo/NSpec/issues/83/comments","events_url":"https://api.github.com/repos/mattflo/NSpec/issues/83/events","html_url":"https://github.com/mattflo/NSpec/issues/83","id":93016390,"number":83,"title":"Async before, async expectation","user":{"login":"BrainCrumbz","id":3185573,"avatar_url":"https://avatars.githubusercontent.com/u/3185573?v=3","gravatar_id":"","url":"https://api.github.com/users/BrainCrumbz","html_url":"https://github.com/BrainCrumbz","followers_url":"https://api.github.com/users/BrainCrumbz/followers","following_url":"https://api.github.com/users/BrainCrumbz/following{/other_user}","gists_url":"https://api.github.com/users/BrainCrumbz/gists{/gist_id}","starred_url":"https://api.github.com/users/BrainCrumbz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrainCrumbz/subscriptions","organizations_url":"https://api.github.com/users/BrainCrumbz/orgs","repos_url":"https://api.github.com/users/BrainCrumbz/repos","events_url":"https://api.github.com/users/BrainCrumbz/events{/privacy}","received_events_url":"https://api.github.com/users/BrainCrumbz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":36,"created_at":"2015-07-04T14:24:48Z","updated_at":"2015-08-11T07:25:14Z","closed_at":null,"body":"Does the NSpec framework support `async` functions set on `before`? And on `it[]` expectations? E.g. (just a dummy example to get what we're referring to):\r\n\r\n```c#\r\n// [...]\r\nvoid Give_some_condition()\r\n{\r\n  before = () => setCondition();\r\n\r\n  context[\"When something async happens\"] = () =>\r\n  {\r\n    before = async () => { await doSomethingAsync(); };\r\n  };\r\n\r\n  it[\"Should verify after async operation completed\"] = async () => \r\n  {\r\n    await Task.Delay(someTimeInMillis);\r\n\r\n    verifyItCompleted();\r\n  };\r\n}\r\n```\r\n\r\nAt first I thought the framework did support, but then some async expectations we're completing successfully even if that was not supposed to be, so now I think the test just passes on and completes expectation successfully without really coming back to the *moveNext*, where the actual condition is tested."},"comment":{"url":"https://api.github.com/repos/mattflo/NSpec/issues/comments/129738605","html_url":"https://github.com/mattflo/NSpec/issues/83#issuecomment-129738605","issue_url":"https://api.github.com/repos/mattflo/NSpec/issues/83","id":129738605,"user":{"login":"BrainCrumbz","id":3185573,"avatar_url":"https://avatars.githubusercontent.com/u/3185573?v=3","gravatar_id":"","url":"https://api.github.com/users/BrainCrumbz","html_url":"https://github.com/BrainCrumbz","followers_url":"https://api.github.com/users/BrainCrumbz/followers","following_url":"https://api.github.com/users/BrainCrumbz/following{/other_user}","gists_url":"https://api.github.com/users/BrainCrumbz/gists{/gist_id}","starred_url":"https://api.github.com/users/BrainCrumbz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrainCrumbz/subscriptions","organizations_url":"https://api.github.com/users/BrainCrumbz/orgs","repos_url":"https://api.github.com/users/BrainCrumbz/repos","events_url":"https://api.github.com/users/BrainCrumbz/events{/privacy}","received_events_url":"https://api.github.com/users/BrainCrumbz/received_events","type":"User","site_admin":false},"created_at":"2015-08-11T07:25:14Z","updated_at":"2015-08-11T07:25:14Z","body":"What do you think about this asyncBefore approach, confining the async *virus* at the very border with client code? If this proves to work without deadlocks, it could be a clean way to upgrade the framework."}}