Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d5b19b9

Browse files
committed
GP-47 Fix imports in test
1 parent 52c65f9 commit d5b19b9

File tree

1 file changed

+19
-11
lines changed
  • 5-0-functional-programming/src/test/java/com/bobocode/lambda_math_functions

1 file changed

+19
-11
lines changed

‎5-0-functional-programming/src/test/java/com/bobocode/lambda_math_functions/FunctionsTest.java‎

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
11
package com.bobocode.lambda_math_functions;
22

3-
@TestMethodOrder( MethodOrderer.OrderAnnotation.class)
3+
import org.junit.jupiter.api.*;
4+
5+
import java.util.function.Function;
6+
7+
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
8+
import static org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType;
9+
10+
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
411
public class FunctionsTest {
5-
private com.bobocode.FunctionMap<Integer, Integer> integerFunctionMap;
12+
private FunctionMap<Integer, Integer> integerFunctionMap;
613

714
@BeforeEach
815
public void init() {
9-
integerFunctionMap = com.bobocode.Functions.intFunctionMap();
16+
integerFunctionMap = Functions.intFunctionMap();
1017
}
1118

1219
@Test
1320
@Order(7)
1421
void squareFunction() {
1522
Function<Integer, Integer> squareFunction = integerFunctionMap.getFunction("square");
1623

17-
int actualResult = squareFunction.apply(5);
24+
int result = squareFunction.apply(5);
1825

1926
assertThat(result).isEqualTo(25);
2027
}
@@ -24,7 +31,7 @@ void squareFunction() {
2431
void absFunction() {
2532
Function<Integer, Integer> absFunction = integerFunctionMap.getFunction("abs");
2633

27-
int actualResult = absFunction.apply(-192);
34+
int result = absFunction.apply(-192);
2835

2936
assertThat(result).isEqualTo(192);
3037
}
@@ -34,7 +41,7 @@ void absFunction() {
3441
void incrementFunction() {
3542
Function<Integer, Integer> incrementFunction = integerFunctionMap.getFunction("increment");
3643

37-
int actualResult = incrementFunction.apply(399);
44+
int result = incrementFunction.apply(399);
3845

3946
assertThat(result).isEqualTo(400);
4047
}
@@ -44,7 +51,7 @@ void incrementFunction() {
4451
void destDecrementFunction() {
4552
Function<Integer, Integer> decrementFunction = integerFunctionMap.getFunction("decrement");
4653

47-
int actualResult = decrementFunction.apply(800);
54+
int result = decrementFunction.apply(800);
4855

4956
assertThat(result).isEqualTo(799);
5057
}
@@ -54,7 +61,7 @@ void destDecrementFunction() {
5461
void signFunctionOnNegativeValue() {
5562
Function<Integer, Integer> signFunction = integerFunctionMap.getFunction("sgn");
5663

57-
int actualResult = signFunction.apply(-123);
64+
int result = signFunction.apply(-123);
5865

5966
assertThat(result).isEqualTo(-1);
6067
}
@@ -64,7 +71,7 @@ void signFunctionOnNegativeValue() {
6471
void signFunctionOnPositiveValue() {
6572
Function<Integer, Integer> signFunction = integerFunctionMap.getFunction("sgn");
6673

67-
int actualResult = signFunction.apply(23);
74+
int result = signFunction.apply(23);
6875

6976
assertThat(result).isEqualTo(1);
7077
}
@@ -74,14 +81,15 @@ void signFunctionOnPositiveValue() {
7481
void signFunctionOnZero() {
7582
Function<Integer, Integer> signFunction = integerFunctionMap.getFunction("sgn");
7683

77-
int actualResult = signFunction.apply(0);
84+
int result = signFunction.apply(0);
7885

7986
assertThat(result).isEqualTo(0);
8087
}
8188

8289
@Test
8390
@Order(8)
8491
void getUnknownFunction() {
85-
assertThatExceptionOfType(InvalidFunctionNameException.class).isThrownBy(() -> integerFunctionMap.getFunction("sqrt"));
92+
assertThatExceptionOfType(InvalidFunctionNameException.class).isThrownBy(()
93+
-> integerFunctionMap.getFunction("sqrt"));
8694
}
8795
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /