-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new type: Patterns.IO.FileSize #71
Comments
Each of the constants listed above should be made available as public constant fields. Let the consumer know what they're getting with each value: long kb = FileSize.OneKilobyte; |
And now that I read it, it looks ridiculous, unless the type itself is ridiculous, and I'm just now picking up on it. If we expose the base |
I agree with the last thought. 1024 x N right? Brandon Law
|
I with dropping this altogether. The whole concept can be a part of metrics conversion class. |
Why not a bunch of extension methods so you could just do |
^^^ I feel like Wesam's answer is almost spot-on, but a metric conversion class that concerned itself with anything other than file sizes would break SRP by doing so. I really love Chris's idea. It feels SO Ruby. I wonder why that is ;) |
I take it that none of those types inherit from |
The common base type is ValueType, which is not descriptive enough and is
|
I'm taking this, and I'm gonna do both things: expose a 3.5.Gigabytes().Should().BeGreaterThan(3500.Megabytes()); //which seems weird at first |
Stupid question. .. why do you need it? What were you doing that made Brandon Law
|
It's to fill a very small gap. It's similar to the gap that you'd feel if there were no logOptions.Mode = LogModes.RollingFile;
logOptions.MaxFileSize = FileSize.FromMegabytes(5); Only now, with the new syntax, it will look more like: logOptions.MaxFileSize = 5.Megabytes(); Which I like a LOT better. |
AC: the following code has been added to Patterns along with features supplying coverage of each helper method
The text was updated successfully, but these errors were encountered: