{"action":"created","issue":{"url":"https://api.github.com/repos/nunit/nunit/issues/1667","repository_url":"https://api.github.com/repos/nunit/nunit","labels_url":"https://api.github.com/repos/nunit/nunit/issues/1667/labels{/name}","comments_url":"https://api.github.com/repos/nunit/nunit/issues/1667/comments","events_url":"https://api.github.com/repos/nunit/nunit/issues/1667/events","html_url":"https://github.com/nunit/nunit/issues/1667","id":165621382,"number":1667,"title":"Request for Has.FewerThan","user":{"login":"jnm2","id":8040367,"avatar_url":"https://avatars.githubusercontent.com/u/8040367?v=3","gravatar_id":"","url":"https://api.github.com/users/jnm2","html_url":"https://github.com/jnm2","followers_url":"https://api.github.com/users/jnm2/followers","following_url":"https://api.github.com/users/jnm2/following{/other_user}","gists_url":"https://api.github.com/users/jnm2/gists{/gist_id}","starred_url":"https://api.github.com/users/jnm2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnm2/subscriptions","organizations_url":"https://api.github.com/users/jnm2/orgs","repos_url":"https://api.github.com/users/jnm2/repos","events_url":"https://api.github.com/users/jnm2/events{/privacy}","received_events_url":"https://api.github.com/users/jnm2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-07-14T17:58:44Z","updated_at":"2016-07-14T21:04:37Z","closed_at":null,"body":"`Has.Exactly(expectedCount).With.Condition` is a great pattern. I have just as much need in my tests of using `Has.FewerThan`.\r\n\r\nHere's what I'm thinking:\r\n\r\n`Has.FewerThan(count)` - `<`\r\n`Has.MoreThan(count)` - `>`\r\n`Has.AtMost(count)` - `<=` (or possibly `Has.NoMoreThan`)\r\n`Has.AtLeast(count)` - `>=` (or possibly `Has.NoFewerThan`)\r\n\r\nThe second part of the request is to be able to use `FewerThan` without an added condition. \r\n`Assert.That(collection, Has.FewerThan(3))` reads better than `Assert.That(collection.Count, Is.LessThan(3))` and gives a better failure message. It's also more consistent next to `Assert.That(collection, Has.FewerThan(2).With.Condition)`.\r\n\r\nCurrently this same thing is not possible with `Has.Exactly`, but the same logic would apply as applies to `Has.FewerThan` and so I would request that as well."},"comment":{"url":"https://api.github.com/repos/nunit/nunit/issues/comments/232792051","html_url":"https://github.com/nunit/nunit/issues/1667#issuecomment-232792051","issue_url":"https://api.github.com/repos/nunit/nunit/issues/1667","id":232792051,"user":{"login":"jnm2","id":8040367,"avatar_url":"https://avatars.githubusercontent.com/u/8040367?v=3","gravatar_id":"","url":"https://api.github.com/users/jnm2","html_url":"https://github.com/jnm2","followers_url":"https://api.github.com/users/jnm2/followers","following_url":"https://api.github.com/users/jnm2/following{/other_user}","gists_url":"https://api.github.com/users/jnm2/gists{/gist_id}","starred_url":"https://api.github.com/users/jnm2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnm2/subscriptions","organizations_url":"https://api.github.com/users/jnm2/orgs","repos_url":"https://api.github.com/users/jnm2/repos","events_url":"https://api.github.com/users/jnm2/events{/privacy}","received_events_url":"https://api.github.com/users/jnm2/received_events","type":"User","site_admin":false},"created_at":"2016-07-14T21:04:37Z","updated_at":"2016-07-14T21:04:37Z","body":"@rprouse Very true. What spurred this is that it seems inconsistent to have `Has.Exactly(count).With.Property(\"Enabled\").EqualTo(true)` but no analog that allows you to work with other count comparisons. The request isn't that far from existing code or concepts used in `Has.Exactly`."}}
{"actor":{"display_login":"jnm2"}}