Repository navigation
London | 26-Java-June | Mikiyas Gebremichael | Sprint 3 | Prep exercises - #60
Open
Mikiyas-STP wants to merge 16 commits into
Open
Mikiyas-STP wants to merge 16 commits into
Mikiyas-STP wants to merge 16 commits into
Conversation
jacknewman1995
suggested changes
Aug 4, 2026
jacknewman1995
left a comment
There was a problem hiding this comment.
Looks good - avoid classnames like "new" and try to name classes according to the real objects the represent.
| return a\ * b; | ||
| } | ||
|
|
||
| public int divide(int a, int b) { |
There was a problem hiding this comment.
Should there be a square root method in here too?
There was a problem hiding this comment.
Ah you've got it in a separate file, how come?
| @BeforeEach | ||
| void setUp() { | ||
| calculator = new Calculator(); | ||
| } |
There was a problem hiding this comment.
You don't need the before each here - junit creates a new instance of the test class when each test method is run, so you can just instantiate as a new private field
There was a problem hiding this comment.
This is not a good class name - class names should indicate the object represented by the class.
| public class CalculatorNew { | ||
|
|
||
| public int add(int a, int b) { | ||
| return a + b; |
There was a problem hiding this comment.
Why have we duplicated all this code?
| } | ||
|
|
||
| public List<String> splitCommaSeparatedLine(String s) { | ||
| return Arrays.asList(s.split(",")); |
| @ParameterizedTest(name = "\"{0}\" should return {1}") | ||
| @CsvSource({ | ||
| "level, true", | ||
| "racecar, true",a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
Questions
Ask any questions you have for your reviewer. You must remove this section if you have no questions.