FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
java_upgrade/src/test/java/streams/SumBigDecimalsTest.java at main · ps4/java_upgrade · GitHub
ps4
/
java_upgrade
Public
forked from
kousen/java_upgrade
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
java_upgrade
/
src
/
test
/
java
/
streams
/
SumBigDecimalsTest.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
33 lines (24 loc) · 916 Bytes
Breadcrumbs
java_upgrade
/
src
/
test
/
java
/
streams
/
SumBigDecimalsTest.java
Copy path
File metadata and controls
33 lines (24 loc) · 916 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package
streams
;
import
org
.
junit
.
jupiter
.
api
.
Disabled
;
import
org
.
junit
.
jupiter
.
api
.
Test
;
import
java
.
math
.
BigDecimal
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertEquals
;
public
class
SumBigDecimalsTest
{
private
final
SumBigDecimals
summer
=
new
SumBigDecimals
();
@
Test
public
void
sumFirstN_usingReduce
() {
BigDecimal
answer
=
summer
.
sumFirstN_usingReduce
(
10
);
assertEquals
(
new
BigDecimal
(
"55"
),
answer
);
}
@
Test
@
Disabled
(
"disable until demo"
)
public
void
sumFirstNDoubledValues
() {
BigDecimal
answer
=
summer
.
sumDoubles
(
10
);
// Used to show how reduce method without identity can give error
assertEquals
(
new
BigDecimal
(
"110"
),
answer
);
}
@
Test
public
void
sumFirstNDoubledValuesInitialized
() {
BigDecimal
answer
=
summer
.
sumDoublesInitialized
(
10
);
assertEquals
(
new
BigDecimal
(
"110"
),
answer
);
}
}
Back
|
FazBrowse Home
|
New Git URL