{"action":"created","issue":{"url":"https://api.github.com/repos/tpierrain/NFluent/issues/131","labels_url":"https://api.github.com/repos/tpierrain/NFluent/issues/131/labels{/name}","comments_url":"https://api.github.com/repos/tpierrain/NFluent/issues/131/comments","events_url":"https://api.github.com/repos/tpierrain/NFluent/issues/131/events","html_url":"https://github.com/tpierrain/NFluent/pull/131","id":116804431,"number":131,"title":"Proposal: Add First and Single extension methods for collection checks","user":{"login":"ocoanet","id":1525572,"avatar_url":"https://avatars.githubusercontent.com/u/1525572?v=3","gravatar_id":"","url":"https://api.github.com/users/ocoanet","html_url":"https://github.com/ocoanet","followers_url":"https://api.github.com/users/ocoanet/followers","following_url":"https://api.github.com/users/ocoanet/following{/other_user}","gists_url":"https://api.github.com/users/ocoanet/gists{/gist_id}","starred_url":"https://api.github.com/users/ocoanet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ocoanet/subscriptions","organizations_url":"https://api.github.com/users/ocoanet/orgs","repos_url":"https://api.github.com/users/ocoanet/repos","events_url":"https://api.github.com/users/ocoanet/events{/privacy}","received_events_url":"https://api.github.com/users/ocoanet/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-11-13T16:42:00Z","updated_at":"2015-11-17T13:58:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/tpierrain/NFluent/pulls/131","html_url":"https://github.com/tpierrain/NFluent/pull/131","diff_url":"https://github.com/tpierrain/NFluent/pull/131.diff","patch_url":"https://github.com/tpierrain/NFluent/pull/131.patch"},"body":"I regularly need to check properties on the first or single element of a collection.\r\nIt is easy to write:\r\n```cs\r\nCheck.That(enumerable.First()).IsEqualTo(42);\r\n```\r\nYet I would like the exception to be generated from an assertion and not from the `First` method.\r\nMy tests can use custom `ExpectedFirst` and `ExpectedSingle` methods but those do not really follow the NFluent philosophy.\r\n\r\nSo I propose to add extension methods for collection checks that could be used in the following way:\r\n```cs\r\nCheck.That(enumerable).First().IsEqualTo(42);\r\n```"},"comment":{"url":"https://api.github.com/repos/tpierrain/NFluent/issues/comments/157376566","html_url":"https://github.com/tpierrain/NFluent/pull/131#issuecomment-157376566","issue_url":"https://api.github.com/repos/tpierrain/NFluent/issues/131","id":157376566,"user":{"login":"tpierrain","id":2824069,"avatar_url":"https://avatars.githubusercontent.com/u/2824069?v=3","gravatar_id":"","url":"https://api.github.com/users/tpierrain","html_url":"https://github.com/tpierrain","followers_url":"https://api.github.com/users/tpierrain/followers","following_url":"https://api.github.com/users/tpierrain/following{/other_user}","gists_url":"https://api.github.com/users/tpierrain/gists{/gist_id}","starred_url":"https://api.github.com/users/tpierrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tpierrain/subscriptions","organizations_url":"https://api.github.com/users/tpierrain/orgs","repos_url":"https://api.github.com/users/tpierrain/repos","events_url":"https://api.github.com/users/tpierrain/events{/privacy}","received_events_url":"https://api.github.com/users/tpierrain/received_events","type":"User","site_admin":false},"created_at":"2015-11-17T13:58:57Z","updated_at":"2015-11-17T13:58:57Z","body":"Absolutely. \n\nIf you want -and if there is no rush- I can implement it, but I'd be very happy to have your contribution on this.\n\nAs a source of inspiration, you can see the INullableOrNumberCheckLink interface (where the \"Which\" property/operator is currently handled)\n\nJust let me know if you want me to implement it or not.\n\nAnd again, thanks for using NFluent and making it better via your feedbacks and contributions. \n\nCheers\n\n"}}