GitHub PullRequestReviewCommentEvent at 2014-04-13 07:27:12
Repository: AutoFixture
Actor: ploeh
Payload: {"comment":{"url":"https://api.github.com/repos/AutoFixture/AutoFixture/pulls/comments/11563653","id":11563653,"diff_hunk":"@@ -1019,6 +1019,64 @@ public void VerifyIgnoresGuardAssertionForOutParameter()\n             Assert.DoesNotThrow(() => sut.Verify(methodInfo));\r\n         }\r\n \r\n+        [Fact]\r\n+        public void VerifyOnTaskDeferredGuardThrowsExceptionWithExtraHelpfulMessage()\r\n+        {\r\n+            // Fixture setup\r\n+            var sut = new GuardClauseAssertion(new Fixture());\r\n+            var asyncMethodHost = new AsyncHost();\r\n+\r\n+            var theMethod = from m in new Ploeh.Albedo.Methods<AsyncHost>()\r\n+                            select m.TaskWithInnerGuardClause(null);\r\n+            // Exercise system\r\n+            var e = Assert.Throws<GuardClauseException>(() => sut.Verify(theMethod));\r\n+            // Verify outcome\r\n+            Assert.Contains(\"Task\", e.Message);\r\n+            Assert.Contains(\"async\", e.Message);\r\n+        }\r\n+\r\n+        [Fact]\r\n+        public void VerifyOnTaskOfTDeferredGuardThrowsExceptionWithExtraHelpfulMessage()\r\n+        {\r\n+            // Fixture setup\r\n+            var sut = new GuardClauseAssertion(new Fixture());\r\n+            var asyncMethodHost = new AsyncHost();\r\n+\r\n+            var theMethod = from m in new Ploeh.Albedo.Methods<AsyncHost>()\r\n+                            select m.TaskOfTWithInnerGuardClause(null);\r\n+\r\n+            // Exercise system\r\n+            var e = Assert.Throws<GuardClauseException>(() => sut.Verify(theMethod));\r\n+            // Verify outcome\r\n+            Assert.Contains(\"Task\", e.Message);\r\n+            Assert.Contains(\"async\", e.Message);\r\n+        }\r\n+\r","path":"Src/IdiomsUnitTest/GuardClauseAssertionTest.cs","position":36,"original_position":36,"commit_id":"96694fa453117f9e53056df391b6e823326d3ed8","original_commit_id":"96694fa453117f9e53056df391b6e823326d3ed8","user":{"login":"ploeh","id":242165,"avatar_url":"https://avatars.githubusercontent.com/u/242165?","gravatar_id":"f95ad9169126f7dd4a4211fd61871dfd","url":"https://api.github.com/users/ploeh","html_url":"https://github.com/ploeh","followers_url":"https://api.github.com/users/ploeh/followers","following_url":"https://api.github.com/users/ploeh/following{/other_user}","gists_url":"https://api.github.com/users/ploeh/gists{/gist_id}","starred_url":"https://api.github.com/users/ploeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ploeh/subscriptions","organizations_url":"https://api.github.com/users/ploeh/orgs","repos_url":"https://api.github.com/users/ploeh/repos","events_url":"https://api.github.com/users/ploeh/events{/privacy}","received_events_url":"https://api.github.com/users/ploeh/received_events","type":"User","site_admin":false},"body":"Do we have tests that cover the scenario where a method is returning `Task` and correctly implements a Guard Clause in the Fail First manner?","created_at":"2014-04-13T07:27:12Z","updated_at":"2014-04-13T07:27:12Z","html_url":"https://github.com/AutoFixture/AutoFixture/pull/279#discussion_r11563653","pull_request_url":"https://api.github.com/repos/AutoFixture/AutoFixture/pulls/279","_links":{"self":{"href":"https://api.github.com/repos/AutoFixture/AutoFixture/pulls/comments/11563653"},"html":{"href":"https://github.com/AutoFixture/AutoFixture/pull/279#discussion_r11563653"},"pull_request":{"href":"https://api.github.com/repos/AutoFixture/AutoFixture/pulls/279"}}}}