PrintsCharming / ObjectHydrator

This project allows you to pass custom POCO's to it, and have it return an instance of the class populated with randomly generated data. This random data can be overridden by convention.
Apache License 2.0
39 stars 19 forks source link

CultureInfo properties generator #26

Closed ushenkodmitry closed 6 years ago

ushenkodmitry commented 6 years ago

Might be handy in international application development. Also i've added .vs folder to the gitignore file.

rikrak commented 6 years ago

@ushenkodmitry Minor review comment: I think the randomisation in the generate method is permanently excluding the last item in the list.
The line: var next = _random.Next(0, cultures.Length - 1); Should be: var next = _random.Next(0, cultures.Length); (The max value of random is exclusive: https://msdn.microsoft.com/en-us/library/2dx6wyd4(v=vs.110).aspx)

I just fixed this in my own pull requests too! :-)

ushenkodmitry commented 6 years ago

Thanks for the comment. I will update PR.

чт, 22 марта 2018 г., 13:47 Rik Crompton notifications@github.com:

@ushenkodmitry https://github.com/ushenkodmitry Minor review comment: I think the randomisation in the generate method is permanently excluding the last item in the list. The line: var next = _random.Next(0, cultures.Length - 1); Should be: var next = _random.Next(0, cultures.Length); (The max value of random is exclusive: https://msdn.microsoft.com/en-us/library/2dx6wyd4(v=vs.110).aspx)

I just fixed this in my own pull requests too! :-)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/PrintsCharming/ObjectHydrator/pull/26#issuecomment-375260256, or mute the thread https://github.com/notifications/unsubscribe-auth/AP7WHy84JJ3ohGfd_a6vmsNeapE8was3ks5tg4EngaJpZM4S2tRH .

PrintsCharming commented 6 years ago

Fixed this issue @rikrak mentioned and merged into 1-3Pre

ushenkodmitry commented 6 years ago

Thanks!

пт, 23 марта 2018 г., 6:14 Ryan Smith notifications@github.com:

Fixed this issue @rikrak https://github.com/rikrak mentioned and merged into 1-3Pre

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/PrintsCharming/ObjectHydrator/pull/26#issuecomment-375530701, or mute the thread https://github.com/notifications/unsubscribe-auth/AP7WH8BpQR9OmcF_8ZD3OysNWGy0tg14ks5thGh9gaJpZM4S2tRH .