Skip to content
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

Added unit test for FreezeAmount on Amount #443

Merged
merged 1 commit into from Dec 6, 2019

Conversation

@TrustHenry
Copy link
Member

TrustHenry commented Dec 6, 2019

Make sure there are no decimal places in the FreezeAmount.
Compare the same as 40,000BOA.
It tests the function of Amount.integral

@TrustHenry TrustHenry added this to the 2. Validator milestone Dec 6, 2019
@codecov

This comment has been minimized.

Copy link

codecov bot commented Dec 6, 2019

Codecov Report

Merging #443 into v0.x.x will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           v0.x.x     #443      +/-   ##
==========================================
+ Coverage   87.37%   87.38%   +<.01%     
==========================================
  Files          53       53              
  Lines        3620     3622       +2     
==========================================
+ Hits         3163     3165       +2     
  Misses        457      457
Flag Coverage Δ
#integration 55.19% <ø> (-0.13%) ⬇️
#unittests 85.9% <100%> (ø) ⬆️
Impacted Files Coverage Δ
source/agora/common/Amount.d 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8d110ce...7825226. Read the comment docs.

@@ -259,6 +259,11 @@ pure @safe nothrow @nogc unittest

assert(Amount(100_500_000).integral() == 10);
assert(Amount(100_500_000).decimal() == 500_000);

assert(Amount.FreezeAmount.decimal() == 0);
assert(Amount(400_000_000_000, true).integral() == Amount.FreezeAmount.integral());

This comment has been minimized.

Copy link
@Geod24

Geod24 Dec 6, 2019

Member

The decimal test is good, but testing a constant is rarely adding value, as those rarely change.
I would just replace this and following lines by assert(Amount.FreezeAmount.integral() == 40_000);, which is testing an expectation with the integral function.

This comment has been minimized.

Copy link
@TrustHenry

TrustHenry Dec 6, 2019

Author Member

applied the suggest.

@TrustHenry TrustHenry force-pushed the TrustHenry:unittestAmount branch from 03c6743 to 3e36636 Dec 6, 2019
Make sure there are no decimal places in the FreezeAmount.
Compare the same as 40,000BOA.
It tests the function of Amount.integral
@TrustHenry TrustHenry force-pushed the TrustHenry:unittestAmount branch from 3e36636 to 7825226 Dec 6, 2019
@Geod24
Geod24 approved these changes Dec 6, 2019
@linked0
linked0 approved these changes Dec 6, 2019
@linked0 linked0 merged commit 2a1c7a9 into bpfkorea:v0.x.x Dec 6, 2019
12 checks passed
12 checks passed
MacOS (macOS-latest, dmd-2.089.0)
Details
MacOS (macOS-latest, dmd-2.088.1)
Details
MacOS (macOS-latest, dmd-master)
Details
Linux (ubuntu-latest, dmd-2.089.0)
Details
Linux (ubuntu-latest, dmd-2.088.1)
Details
Linux (ubuntu-latest, ldc-1.18.0)
Details
Linux (ubuntu-latest, ldc-1.17.0)
Details
Linux (ubuntu-latest, dmd-master)
Details
Linux (ubuntu-latest, ldc-master)
Details
Travis CI - Pull Request Build Passed
Details
ci/circleci: build Your tests passed on CircleCI!
Details
ci/dockercloud Your tests passed in Docker Cloud
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.