{"action":"created","issue":{"url":"https://api.github.com/repos/AutoFixture/AutoFixture/issues/403","labels_url":"https://api.github.com/repos/AutoFixture/AutoFixture/issues/403/labels{/name}","comments_url":"https://api.github.com/repos/AutoFixture/AutoFixture/issues/403/comments","events_url":"https://api.github.com/repos/AutoFixture/AutoFixture/issues/403/events","html_url":"https://github.com/AutoFixture/AutoFixture/pull/403","id":75860960,"number":403,"title":"Guard clause in RecursionGuard and OmitOnRecursionBehavior constructors","user":{"login":"Pvlerick","id":4704411,"avatar_url":"https://avatars.githubusercontent.com/u/4704411?v=3","gravatar_id":"","url":"https://api.github.com/users/Pvlerick","html_url":"https://github.com/Pvlerick","followers_url":"https://api.github.com/users/Pvlerick/followers","following_url":"https://api.github.com/users/Pvlerick/following{/other_user}","gists_url":"https://api.github.com/users/Pvlerick/gists{/gist_id}","starred_url":"https://api.github.com/users/Pvlerick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pvlerick/subscriptions","organizations_url":"https://api.github.com/users/Pvlerick/orgs","repos_url":"https://api.github.com/users/Pvlerick/repos","events_url":"https://api.github.com/users/Pvlerick/events{/privacy}","received_events_url":"https://api.github.com/users/Pvlerick/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-13T06:07:20Z","updated_at":"2015-05-13T08:13:07Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/AutoFixture/AutoFixture/pulls/403","html_url":"https://github.com/AutoFixture/AutoFixture/pull/403","diff_url":"https://github.com/AutoFixture/AutoFixture/pull/403.diff","patch_url":"https://github.com/AutoFixture/AutoFixture/pull/403.patch"},"body":"Guard clause for the recursionDepth parameter that should be strictly higher than zero.\r\nUnit tests added in both cases.\r\n\r\nAddressing #337 "},"comment":{"url":"https://api.github.com/repos/AutoFixture/AutoFixture/issues/comments/101565277","html_url":"https://github.com/AutoFixture/AutoFixture/pull/403#issuecomment-101565277","issue_url":"https://api.github.com/repos/AutoFixture/AutoFixture/issues/403","id":101565277,"user":{"login":"moodmosaic","id":287532,"avatar_url":"https://avatars.githubusercontent.com/u/287532?v=3","gravatar_id":"","url":"https://api.github.com/users/moodmosaic","html_url":"https://github.com/moodmosaic","followers_url":"https://api.github.com/users/moodmosaic/followers","following_url":"https://api.github.com/users/moodmosaic/following{/other_user}","gists_url":"https://api.github.com/users/moodmosaic/gists{/gist_id}","starred_url":"https://api.github.com/users/moodmosaic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moodmosaic/subscriptions","organizations_url":"https://api.github.com/users/moodmosaic/orgs","repos_url":"https://api.github.com/users/moodmosaic/repos","events_url":"https://api.github.com/users/moodmosaic/events{/privacy}","received_events_url":"https://api.github.com/users/moodmosaic/received_events","type":"User","site_admin":false},"created_at":"2015-05-13T08:13:07Z","updated_at":"2015-05-13T08:13:07Z","body":"I've just verified the code in this Pull Request, with the code sample provided by @dcastro [here](https://github.com/AutoFixture/AutoFixture/issues/337#issue-54626803), and seems to be working as expected now:\r\n\r\n```csharp\r\nvar fixture = new Fixture();\r\nfixture.Behaviors.OfType<ThrowingRecursionBehavior>().ToList()\r\n    .ForEach(b => fixture.Behaviors.Remove(b));\r\nfixture.Behaviors.Add(new OmitOnRecursionBehavior(0));\r\n\r\nfixture.Create<string>();\r\n```\r\nOutput:\r\n\r\n```\r\nTest 'Ploeh.AutoFixtureUnitTest.CollectionFillerTest.Test' failed\r\n    : System.ArgumentOutOfRangeException \r\n    : Specified argument was out of the range of valid values.\r\nParameter name: recursionDepth\r\n    OmitOnRecursionBehavior.cs(33,0)\r\n        : at Ploeh.AutoFixture.OmitOnRecursionBehavior..ctor(Int32 recursionDepth)\r\n    CollectionFillerTest.cs(24,0)\r\n        : at Ploeh.AutoFixtureUnitTest.CollectionFillerTest.Test()\r\n```"}}