-
-
Notifications
You must be signed in to change notification settings - Fork 506
GP-47 Migrate lambda-math-functions #45
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
Conversation
We added test ordering to provide a natural exercises completion. It should help to do exercises in the most right order. |
Your ordering seems right, but you can also make corresponding methods sequence in the test class. |
|
||
@Test | ||
@Order(8) | ||
void getGetUnknownFunction() { |
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 think we have redundant appendix here.
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.
Sorry, I have already corrected it.
|
||
int actualResult = squareFunction.apply(5); | ||
|
||
assertEquals(25, actualResult); |
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.
You should replace all the assertions by "AssertJ" corresponding to Migration Guide .
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 corrected it, at least I think so.
I do not fully understand what I am doing and how to do it correctly.
But I hope this time is what it was about it.
|
||
import java.util.function.Function; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; |
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.
If everything is correct these imports are redundant.
@Test | ||
@Order(8) | ||
void getUnknownFunction() { | ||
assertThrows(InvalidFunctionNameException.class, () -> integerFunctionMap.getFunction("sqrt")); |
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.
AssertJ also supports exceptions. AssertJ Doc
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.
Sorry, but unfortunately I don't know how to change it. Could you please tell me how to do it. What exactly needs to be written. Unfortunately, I don't understand it yet.
5-0-functional-programming/src/test/java/com/bobocode/lambda_math_functions/FunctionsTest.java
Show resolved
Hide resolved
acc24f5
to
ccf7b46
Compare
I'm not sure if I did everything right.
Did I have to sort @order in order in the test?