Add an Extensions namespace for helper extension methods.#675
Add an Extensions namespace for helper extension methods.#675dennisdoomen merged 2 commits intofluentassertions:release-5.0from bcowdery:release-5.0
Conversation
| public static TimeSpan Nanoseconds(this int nanoseconds) | ||
| { | ||
| return ((long)Math.Round(nanoseconds * TicksPerNanosecond)).Ticks(); | ||
| return ((long)Math.Round((double)(nanoseconds * TicksPerNanosecond))).Ticks(); |
| public static TimeSpan Nanoseconds(this long nanoseconds) | ||
| { | ||
| return ((long)Math.Round(nanoseconds * TicksPerNanosecond)).Ticks(); | ||
| return ((long)Math.Round((double)(nanoseconds * TicksPerNanosecond))).Ticks(); |
There was a problem hiding this comment.
I used ReSharpers refactor tools to move the class into a new package, I think it got a bit overzealous and decided to add casts. I'll back out the change.
Sorry about that!
There was a problem hiding this comment.
No need to feel sorry :)
I just read through the diff and noticed they were introduced, so i spun up VS to see they were marked as redundant.
There was a problem hiding this comment.
Yep. Marked as redundant as on mine as well. Not sure why VS introduced it, I might have fat-fingered my new keyboard this morning and done it by accident or maybe ReSharper was trying to be cleaver.
In either case, I've removed the casts and created new pull request #676. If it's easier to just make the change in the code base just kill the PR and I'll merge the change back into my fork later.
Cheers!
Fix for Issue #674,
Moves DateTime and TimeSpan extensions into the "FluentAssertions.Extensions" namespace. I've also renamed the
TimeSpanConversionExtensionstoFluentTimeSpanExtensionsto follow the naming conventions used in other "helper" extensions.