-
Notifications
You must be signed in to change notification settings - Fork 0
tests added #9
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
tests added #9
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -48,4 +48,12 @@ class CalculatorTest { | |||||||||||||||
| calculator.divide(17,0) | ||||||||||||||||
| } | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| @Test | ||||||||||||||||
| fun `test divide function che divide zero by twenty`() { | ||||||||||||||||
| val calculator = Calculator() | ||||||||||||||||
| assertThrows(ArithmeticException::class.java){ | ||||||||||||||||
| calculator.divide(20,0) | ||||||||||||||||
| } | ||||||||||||||||
| } | ||||||||||||||||
|
Comment on lines
+52
to
+58
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Remove duplicate division-by-zero test. This test is functionally identical to the existing division-by-zero tests (lines 29-34, 37-42, 45-50). Testing division by zero with different dividends doesn't provide additional value since the behavior should be consistent regardless of the dividend. Consider removing this duplicate test: - @Test
- fun `test divide function che divide zero by twenty`() {
- val calculator = Calculator()
- assertThrows(ArithmeticException::class.java){
- calculator.divide(20,0)
- }
- }The existing division-by-zero tests already provide adequate coverage for this edge case. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||
| } | ||||||||||||||||
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.
Remove or fix this meaningless test.
This test method has several issues:
addition_isFalseis misleading and doesn't match what's being testedassertTrue(true)is a trivial assertion that always passes and provides no testing valueEither remove this test or replace it with a meaningful test:
📝 Committable suggestion
🤖 Prompt for AI Agents