Humanizer
Humanizer copied to clipboard
Add ToString and comparison operators to ByteRate with tests
Fixes #802
Here is a checklist you should tick through before submitting a pull request:
- [x] Implementation is clean
- [x] Code adheres to the existing coding standards; e.g. no curlies for one-line blocks, no redundant empty lines between methods or code blocks, spaces rather than tabs, etc.
- [x] No ReSharper warnings
- [x] There is proper unit test coverage
- [x] If the code is copied from StackOverflow (or a blog or OSS) full disclosure is included. That includes required license files and/or file headers explaining where the code came from with proper attribution
- [x] There are very few or no comments (because comments shouldn't be needed if you write clean code)
- [x] Xml documentation is added/updated for the addition/change
- [x] Your PR is (re)based on top of the latest commits from the
dev
branch (more info below) - [x] Link to the issue(s) you're fixing from your PR description. Use
fixes #<the issue number>
- [x] Readme is updated if you change an existing feature or add a new one
- [x] Run either
build.cmd
orbuild.ps1
and ensure there are no test failures
Looks like my typo correction has caused one of the tests to fail. I'll revert that change.
Failing on the approve_public_api test, since that's what I've changed. Was
public class ByteRate
{
public ByteRate(Humanizer.Bytes.ByteSize size, System.TimeSpan interval) { }
public System.TimeSpan Interval { get; }
public Humanizer.Bytes.ByteSize Size { get; }
public string Humanize(Humanizer.Localisation.TimeUnit timeUnit = 1) { }
public string Humanize(string format, Humanizer.Localisation.TimeUnit timeUnit = 1) { }
}
Now
public class ByteRate : System.IComparable, System.IComparable<Humanizer.Bytes.ByteRate>, System.IEquatable<Humanizer.Bytes.ByteRate>
{
public ByteRate(Humanizer.Bytes.ByteSize size, System.TimeSpan interval) { }
public System.TimeSpan Interval { get; }
public Humanizer.Bytes.ByteSize Size { get; }
public int CompareTo(Humanizer.Bytes.ByteRate other) { }
public int CompareTo(object obj) { }
public bool Equals(Humanizer.Bytes.ByteRate other) { }
public string Humanize(Humanizer.Localisation.TimeUnit timeUnit = 1) { }
public string Humanize(string format, Humanizer.Localisation.TimeUnit timeUnit = 1) { }
public override string ToString() { }
public string ToString(string format, Humanizer.Localisation.TimeUnit timeUnit = 1) { }
}
Could do with some feedback or guidance on best way to proceed here.
If you run either build.cmd or build.ps1 it should come up with a method of updating the PublicApiApprovalTest.approve_public_api.approved.txt file.
Once that matches the public api, the test will then pass
Hi Claire, would you be willing to have another look at this, I've hopefully resolved any remaining concerns.
Looks like there's a build error that needs to be resolved?
You're right, I jumped the gun. Looks like some issues in Master
Now passing tests
@Cirzen sorry for the delay. can you rebase and re-approve the api changes