{"action":"created","comment":{"url":"https://api.github.com/repos/Particular/NServiceBus.Testing/pulls/comments/58522804","id":58522804,"diff_hunk":"@@ -49,25 +47,22 @@ public void Validate()\n             }\n         }\n \n-        static TimeSpan GetWithin(SendOptions options)\n+        static TimeoutMessage<object> GetTimeoutMessage(object message, SendOptions options)\n         {\n             var within = options.GetDeliveryDelay();\n-\n-            if (!within.HasValue)\n+            if (within.HasValue)\n             {\n-                var dateTimeOffset = options.GetDeliveryDate();\n-                if (dateTimeOffset != null)\n-                {\n-                    within = dateTimeOffset.Value - DateTimeOffset.Now;\n-                }\n+                return new TimeoutMessage<object>(message, options, within.Value);\n             }\n \n-            if (!within.HasValue)\n+            var dateTimeOffset = options.GetDeliveryDate();\n+            if (dateTimeOffset.HasValue)\n             {\n-                throw new Exception(\"No time has been set for the timeout message\");\n+                return new TimeoutMessage<object>(message, options, dateTimeOffset.Value);\n             }\n \n-            return within.Value;\n+\n+            throw new Exception(\"No TimeSpan or DateTime has been set for the timeout message\");","path":"src/NServiceBus.Testing/TestingContext.cs","position":41,"original_position":41,"commit_id":"57f686e4394b97fc77bbe294275742e7e4d3ca89","original_commit_id":"57f686e4394b97fc77bbe294275742e7e4d3ca89","user":{"login":"mat-mcloughlin","id":2362687,"avatar_url":"https://avatars.githubusercontent.com/u/2362687?v=3","gravatar_id":"","url":"https://api.github.com/users/mat-mcloughlin","html_url":"https://github.com/mat-mcloughlin","followers_url":"https://api.github.com/users/mat-mcloughlin/followers","following_url":"https://api.github.com/users/mat-mcloughlin/following{/other_user}","gists_url":"https://api.github.com/users/mat-mcloughlin/gists{/gist_id}","starred_url":"https://api.github.com/users/mat-mcloughlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mat-mcloughlin/subscriptions","organizations_url":"https://api.github.com/users/mat-mcloughlin/orgs","repos_url":"https://api.github.com/users/mat-mcloughlin/repos","events_url":"https://api.github.com/users/mat-mcloughlin/events{/privacy}","received_events_url":"https://api.github.com/users/mat-mcloughlin/received_events","type":"User","site_admin":false},"body":"It currently does both. I figured we needed the `IsSagaTimeoutMessage` check to distinguish between a timeout message and a defer","created_at":"2016-04-05T11:36:31Z","updated_at":"2016-04-05T11:36:31Z","html_url":"https://github.com/Particular/NServiceBus.Testing/pull/71#discussion_r58522804","pull_request_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/pulls/71","_links":{"self":{"href":"https://api.github.com/repos/Particular/NServiceBus.Testing/pulls/comments/58522804"},"html":{"href":"https://github.com/Particular/NServiceBus.Testing/pull/71#discussion_r58522804"},"pull_request":{"href":"https://api.github.com/repos/Particular/NServiceBus.Testing/pulls/71"}}},"pull_request":{"url":"https://api.github.com/repos/Particular/NServiceBus.Testing/pulls/71","id":65246991,"html_url":"https://github.com/Particular/NServiceBus.Testing/pull/71","diff_url":"https://github.com/Particular/NServiceBus.Testing/pull/71.diff","patch_url":"https://github.com/Particular/NServiceBus.Testing/pull/71.patch","issue_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/issues/71","number":71,"state":"open","locked":false,"title":"Splitting timeout tests to handle DateTime and TimeSpan separately","user":{"login":"mat-mcloughlin","id":2362687,"avatar_url":"https://avatars.githubusercontent.com/u/2362687?v=3","gravatar_id":"","url":"https://api.github.com/users/mat-mcloughlin","html_url":"https://github.com/mat-mcloughlin","followers_url":"https://api.github.com/users/mat-mcloughlin/followers","following_url":"https://api.github.com/users/mat-mcloughlin/following{/other_user}","gists_url":"https://api.github.com/users/mat-mcloughlin/gists{/gist_id}","starred_url":"https://api.github.com/users/mat-mcloughlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mat-mcloughlin/subscriptions","organizations_url":"https://api.github.com/users/mat-mcloughlin/orgs","repos_url":"https://api.github.com/users/mat-mcloughlin/repos","events_url":"https://api.github.com/users/mat-mcloughlin/events{/privacy}","received_events_url":"https://api.github.com/users/mat-mcloughlin/received_events","type":"User","site_admin":false},"body":"Connects to Particular/NServiceBus.Testing#29\r\n\r\nBecause of a race condition in the previous implementation of the testing framework we can't handle timeouts using `DateTime` and `Timespan` together. \r\n\r\nSo now when you call `WhenSagaTimesOut()` with a `DateTime` it will only invoke timeouts set with a `DateTime` and __NOT__ those with a `TimeSpan`\r\n\r\n@timbussmann @hmemcpy can you please take a look","created_at":"2016-04-05T03:39:35Z","updated_at":"2016-04-05T11:36:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"938b3f8bac0ee186d360a7109bc2bd99a0f77701","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/pulls/71/commits","review_comments_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/pulls/71/comments","review_comment_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/issues/71/comments","statuses_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/statuses/57f686e4394b97fc77bbe294275742e7e4d3ca89","head":{"label":"Particular:splitting-timeout-tests","ref":"splitting-timeout-tests","sha":"57f686e4394b97fc77bbe294275742e7e4d3ca89","user":{"login":"Particular","id":5038441,"avatar_url":"https://avatars.githubusercontent.com/u/5038441?v=3","gravatar_id":"","url":"https://api.github.com/users/Particular","html_url":"https://github.com/Particular","followers_url":"https://api.github.com/users/Particular/followers","following_url":"https://api.github.com/users/Particular/following{/other_user}","gists_url":"https://api.github.com/users/Particular/gists{/gist_id}","starred_url":"https://api.github.com/users/Particular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Particular/subscriptions","organizations_url":"https://api.github.com/users/Particular/orgs","repos_url":"https://api.github.com/users/Particular/repos","events_url":"https://api.github.com/users/Particular/events{/privacy}","received_events_url":"https://api.github.com/users/Particular/received_events","type":"Organization","site_admin":false},"repo":{"id":25034101,"name":"NServiceBus.Testing","full_name":"Particular/NServiceBus.Testing","owner":{"login":"Particular","id":5038441,"avatar_url":"https://avatars.githubusercontent.com/u/5038441?v=3","gravatar_id":"","url":"https://api.github.com/users/Particular","html_url":"https://github.com/Particular","followers_url":"https://api.github.com/users/Particular/followers","following_url":"https://api.github.com/users/Particular/following{/other_user}","gists_url":"https://api.github.com/users/Particular/gists{/gist_id}","starred_url":"https://api.github.com/users/Particular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Particular/subscriptions","organizations_url":"https://api.github.com/users/Particular/orgs","repos_url":"https://api.github.com/users/Particular/repos","events_url":"https://api.github.com/users/Particular/events{/privacy}","received_events_url":"https://api.github.com/users/Particular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Particular/NServiceBus.Testing","description":"A framework for composing tests for NServiceBus","fork":false,"url":"https://api.github.com/repos/Particular/NServiceBus.Testing","forks_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/forks","keys_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/teams","hooks_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/hooks","issue_events_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/issues/events{/number}","events_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/events","assignees_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/assignees{/user}","branches_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/branches{/branch}","tags_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/tags","blobs_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/git/refs{/sha}","trees_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/statuses/{sha}","languages_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/languages","stargazers_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/stargazers","contributors_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/contributors","subscribers_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/subscribers","subscription_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/subscription","commits_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/commits{/sha}","git_commits_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/git/commits{/sha}","comments_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/comments{/number}","issue_comment_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/issues/comments{/number}","contents_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/contents/{+path}","compare_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/merges","archive_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/downloads","issues_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/issues{/number}","pulls_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/pulls{/number}","milestones_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/milestones{/number}","notifications_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/labels{/name}","releases_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/releases{/id}","deployments_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/deployments","created_at":"2014-10-10T12:16:14Z","updated_at":"2016-04-04T12:13:45Z","pushed_at":"2016-04-05T03:39:36Z","git_url":"git://github.com/Particular/NServiceBus.Testing.git","ssh_url":"git@github.com:Particular/NServiceBus.Testing.git","clone_url":"https://github.com/Particular/NServiceBus.Testing.git","svn_url":"https://github.com/Particular/NServiceBus.Testing","homepage":"","size":204,"stargazers_count":2,"watchers_count":2,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":4,"forks":5,"open_issues":4,"watchers":2,"default_branch":"develop"}},"base":{"label":"Particular:develop","ref":"develop","sha":"9a5b81c498935a0b7cca8bd2e71a3194495af3df","user":{"login":"Particular","id":5038441,"avatar_url":"https://avatars.githubusercontent.com/u/5038441?v=3","gravatar_id":"","url":"https://api.github.com/users/Particular","html_url":"https://github.com/Particular","followers_url":"https://api.github.com/users/Particular/followers","following_url":"https://api.github.com/users/Particular/following{/other_user}","gists_url":"https://api.github.com/users/Particular/gists{/gist_id}","starred_url":"https://api.github.com/users/Particular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Particular/subscriptions","organizations_url":"https://api.github.com/users/Particular/orgs","repos_url":"https://api.github.com/users/Particular/repos","events_url":"https://api.github.com/users/Particular/events{/privacy}","received_events_url":"https://api.github.com/users/Particular/received_events","type":"Organization","site_admin":false},"repo":{"id":25034101,"name":"NServiceBus.Testing","full_name":"Particular/NServiceBus.Testing","owner":{"login":"Particular","id":5038441,"avatar_url":"https://avatars.githubusercontent.com/u/5038441?v=3","gravatar_id":"","url":"https://api.github.com/users/Particular","html_url":"https://github.com/Particular","followers_url":"https://api.github.com/users/Particular/followers","following_url":"https://api.github.com/users/Particular/following{/other_user}","gists_url":"https://api.github.com/users/Particular/gists{/gist_id}","starred_url":"https://api.github.com/users/Particular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Particular/subscriptions","organizations_url":"https://api.github.com/users/Particular/orgs","repos_url":"https://api.github.com/users/Particular/repos","events_url":"https://api.github.com/users/Particular/events{/privacy}","received_events_url":"https://api.github.com/users/Particular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Particular/NServiceBus.Testing","description":"A framework for composing tests for NServiceBus","fork":false,"url":"https://api.github.com/repos/Particular/NServiceBus.Testing","forks_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/forks","keys_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/teams","hooks_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/hooks","issue_events_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/issues/events{/number}","events_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/events","assignees_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/assignees{/user}","branches_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/branches{/branch}","tags_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/tags","blobs_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/git/refs{/sha}","trees_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/statuses/{sha}","languages_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/languages","stargazers_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/stargazers","contributors_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/contributors","subscribers_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/subscribers","subscription_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/subscription","commits_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/commits{/sha}","git_commits_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/git/commits{/sha}","comments_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/comments{/number}","issue_comment_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/issues/comments{/number}","contents_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/contents/{+path}","compare_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/merges","archive_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/downloads","issues_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/issues{/number}","pulls_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/pulls{/number}","milestones_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/milestones{/number}","notifications_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/labels{/name}","releases_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/releases{/id}","deployments_url":"https://api.github.com/repos/Particular/NServiceBus.Testing/deployments","created_at":"2014-10-10T12:16:14Z","updated_at":"2016-04-04T12:13:45Z","pushed_at":"2016-04-05T03:39:36Z","git_url":"git://github.com/Particular/NServiceBus.Testing.git","ssh_url":"git@github.com:Particular/NServiceBus.Testing.git","clone_url":"https://github.com/Particular/NServiceBus.Testing.git","svn_url":"https://github.com/Particular/NServiceBus.Testing","homepage":"","size":204,"stargazers_count":2,"watchers_count":2,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":4,"forks":5,"open_issues":4,"watchers":2,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Particular/NServiceBus.Testing/pulls/71"},"html":{"href":"https://github.com/Particular/NServiceBus.Testing/pull/71"},"issue":{"href":"https://api.github.com/repos/Particular/NServiceBus.Testing/issues/71"},"comments":{"href":"https://api.github.com/repos/Particular/NServiceBus.Testing/issues/71/comments"},"review_comments":{"href":"https://api.github.com/repos/Particular/NServiceBus.Testing/pulls/71/comments"},"review_comment":{"href":"https://api.github.com/repos/Particular/NServiceBus.Testing/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Particular/NServiceBus.Testing/pulls/71/commits"},"statuses":{"href":"https://api.github.com/repos/Particular/NServiceBus.Testing/statuses/57f686e4394b97fc77bbe294275742e7e4d3ca89"}}}}