-
Notifications
You must be signed in to change notification settings - Fork 386
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
Add Scalar quantity #889
Add Scalar quantity #889
Conversation
e.g. Scalar.FromAmount(1.5).
Codecov Report
@@ Coverage Diff @@
## master #889 +/- ##
==========================================
- Coverage 82.76% 82.70% -0.06%
==========================================
Files 287 289 +2
Lines 43362 43646 +284
==========================================
+ Hits 35888 36098 +210
- Misses 7474 7548 +74
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Just a few minor comments.
/// Purposely did not call it an Int as it is not an int underneath. | ||
/// </summary> | ||
[Fact] | ||
public void ScalarWholeNumberEqualsScalarWholeNumber() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love tests, but I believe these test cases are already covered by the generated tests:
- ArithmeticOperators
- ConversionRoundTrip
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not see those, the one I did see was
Assertion(3, ScalarUnit.Amount, Quantity.From(3, ScalarUnit.Amount));
from IQuantityTests.g.cs
Looking from someone not familiar with the codebase one thing that I will add about the tests that you listed (ArithmeticOperators & ConversionRoundTrip) - they only use integers to test. Looking at the code underneath, it will not make a difference as they are stored as a double anyway, but if that implementation ever changes there may not be sufficient test coverage. I think this is outside of the scope of this PR, so I will remove those tests.
Thanks a lot! A nuget is on the way. |
Fixes #849
e.g. Scalar.FromAmount(1.5).