{"action":"closed","issue":{"url":"https://api.github.com/repos/nbuilder/nbuilder/issues/79","repository_url":"https://api.github.com/repos/nbuilder/nbuilder","labels_url":"https://api.github.com/repos/nbuilder/nbuilder/issues/79/labels{/name}","comments_url":"https://api.github.com/repos/nbuilder/nbuilder/issues/79/comments","events_url":"https://api.github.com/repos/nbuilder/nbuilder/issues/79/events","html_url":"https://github.com/nbuilder/nbuilder/issues/79","id":299212537,"node_id":"MDU6SXNzdWUyOTkyMTI1Mzc=","number":79,"title":"Random generation of enums never includes the last enum-value","user":{"login":"PureKrome","id":899878,"node_id":"MDQ6VXNlcjg5OTg3OA==","avatar_url":"https://avatars1.githubusercontent.com/u/899878?v=4","gravatar_id":"","url":"https://api.github.com/users/PureKrome","html_url":"https://github.com/PureKrome","followers_url":"https://api.github.com/users/PureKrome/followers","following_url":"https://api.github.com/users/PureKrome/following{/other_user}","gists_url":"https://api.github.com/users/PureKrome/gists{/gist_id}","starred_url":"https://api.github.com/users/PureKrome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PureKrome/subscriptions","organizations_url":"https://api.github.com/users/PureKrome/orgs","repos_url":"https://api.github.com/users/PureKrome/repos","events_url":"https://api.github.com/users/PureKrome/events{/privacy}","received_events_url":"https://api.github.com/users/PureKrome/received_events","type":"User","site_admin":false},"labels":[{"id":368665837,"node_id":"MDU6TGFiZWwzNjg2NjU4Mzc=","url":"https://api.github.com/repos/nbuilder/nbuilder/labels/Bug","name":"Bug","color":"d93f0b","default":false}],"state":"closed","locked":false,"assignee":{"login":"crmckenzie","id":947569,"node_id":"MDQ6VXNlcjk0NzU2OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/947569?v=4","gravatar_id":"","url":"https://api.github.com/users/crmckenzie","html_url":"https://github.com/crmckenzie","followers_url":"https://api.github.com/users/crmckenzie/followers","following_url":"https://api.github.com/users/crmckenzie/following{/other_user}","gists_url":"https://api.github.com/users/crmckenzie/gists{/gist_id}","starred_url":"https://api.github.com/users/crmckenzie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crmckenzie/subscriptions","organizations_url":"https://api.github.com/users/crmckenzie/orgs","repos_url":"https://api.github.com/users/crmckenzie/repos","events_url":"https://api.github.com/users/crmckenzie/events{/privacy}","received_events_url":"https://api.github.com/users/crmckenzie/received_events","type":"User","site_admin":false},"assignees":[{"login":"crmckenzie","id":947569,"node_id":"MDQ6VXNlcjk0NzU2OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/947569?v=4","gravatar_id":"","url":"https://api.github.com/users/crmckenzie","html_url":"https://github.com/crmckenzie","followers_url":"https://api.github.com/users/crmckenzie/followers","following_url":"https://api.github.com/users/crmckenzie/following{/other_user}","gists_url":"https://api.github.com/users/crmckenzie/gists{/gist_id}","starred_url":"https://api.github.com/users/crmckenzie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crmckenzie/subscriptions","organizations_url":"https://api.github.com/users/crmckenzie/orgs","repos_url":"https://api.github.com/users/crmckenzie/repos","events_url":"https://api.github.com/users/crmckenzie/events{/privacy}","received_events_url":"https://api.github.com/users/crmckenzie/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/nbuilder/nbuilder/milestones/5","html_url":"https://github.com/nbuilder/nbuilder/milestone/5","labels_url":"https://api.github.com/repos/nbuilder/nbuilder/milestones/5/labels","id":3479464,"node_id":"MDk6TWlsZXN0b25lMzQ3OTQ2NA==","number":5,"title":"6.0.0","description":"","creator":{"login":"crmckenzie","id":947569,"node_id":"MDQ6VXNlcjk0NzU2OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/947569?v=4","gravatar_id":"","url":"https://api.github.com/users/crmckenzie","html_url":"https://github.com/crmckenzie","followers_url":"https://api.github.com/users/crmckenzie/followers","following_url":"https://api.github.com/users/crmckenzie/following{/other_user}","gists_url":"https://api.github.com/users/crmckenzie/gists{/gist_id}","starred_url":"https://api.github.com/users/crmckenzie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crmckenzie/subscriptions","organizations_url":"https://api.github.com/users/crmckenzie/orgs","repos_url":"https://api.github.com/users/crmckenzie/repos","events_url":"https://api.github.com/users/crmckenzie/events{/privacy}","received_events_url":"https://api.github.com/users/crmckenzie/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":1,"state":"open","created_at":"2018-07-06T20:46:10Z","updated_at":"2018-07-06T20:46:41Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2018-02-22T03:47:33Z","updated_at":"2018-07-06T20:46:41Z","closed_at":"2018-07-06T20:46:41Z","author_association":"CONTRIBUTOR","body":"So if I wish to generate a random enum using this code ...\r\n\r\n```\r\nvar statusType = GetRandom.Enumeration<StatusType>();\r\n```\r\n\r\nthe result will be random, but it will **NEVER include the last enum value**. \r\n\r\n### Update\r\n\r\nMy initial reason was wrong, which was why I crossed out the convo below but didn't delete it for future reference, etc.\r\n\r\n---\r\n\r\n~why? [cause of this](https://twitter.com/purekrome/status/966511079672070144)..~\r\n\r\n![image](https://user-images.githubusercontent.com/899878/36519248-7ef32c9a-17de-11e8-8a3d-70146f47b759.png)\r\n\r\n~So basically, [with the .NET Random.Next(min, max) method](https://msdn.microsoft.com/en-us/library/2dx6wyd4(v=vs.110).aspx) :-~\r\n~- `min` is INCLUSIVE (i.e. a _possible_ random result)~\r\n~- `max` is EXCLUSIVE (i.e. will _never_ be a possible random result)~\r\n\r\n![](https://media.giphy.com/media/wxw2e19ZMsjio/giphy.gif)\r\n\r\n![](https://media.giphy.com/media/3oEjHKvjqt5pssL99C/giphy.gif)\r\n\r\n~So to me this is crazy talk, but I cannot change the way `Random.Next` is implemented.~\r\n\r\n----\r\n\r\n~So this means, to fix this issue ... I'm not going to make any suggestions about all the non-enum methods, but for the enum one, I can just bump the `max` value.~\r\n\r\n~PR incoming...~"}}
{"actor":{"display_login":"crmckenzie"}}