Conversation
Codecov Report
@@ Coverage Diff @@
## develop #28 +/- ##
=============================================
+ Coverage 94.78% 95.01% +0.22%
- Complexity 138 210 +72
=============================================
Files 26 40 +14
Lines 307 461 +154
Branches 50 70 +20
=============================================
+ Hits 291 438 +147
- Misses 5 9 +4
- Partials 11 14 +3
Continue to review full report at Codecov.
|
| * @param numberAccount image of type String. | ||
| * @return <code>true</code> \\ <code>false</code> | ||
| */ | ||
| private static boolean size(final String numberAccount) { |
There was a problem hiding this comment.
refactor this method
it can be implemented in a single line of code
| * @param numberAccount image of type String. | ||
| * @return <code>true</code> \\ <code>false</code> | ||
| */ | ||
| private static boolean size(final String numberAccount) { |
There was a problem hiding this comment.
why this method is called size ?
| * @param scannedAccount of String type. | ||
| * @return true. | ||
| */ | ||
| private static boolean sizeImageIsValid(final String scannedAccount) { |
| * @return true if the checksum is ok. | ||
| */ | ||
|
|
||
| public static boolean validate(final String eAN) { |
There was a problem hiding this comment.
refactor this code
avoid the else condition
| * @param stringNumber number | ||
| * @return true if stringNumber length is exactly 13. | ||
| */ | ||
| public static boolean checkCorrectLength(final String stringNumber) { |
| /** | ||
| * Created by administrator on 3/10/2017. | ||
| */ | ||
| public final class Main { |
There was a problem hiding this comment.
Remove this class since you will add unit tests
| }; | ||
|
|
||
| // when: | ||
| String actualResult = BankOcr.numberAccountPresentImage(scannedImage); |
| String actualResult = BankOcr.numberAccountPresentImage(scannedImage); | ||
|
|
||
| // then: | ||
| String expectedResult = "0123456789"; |
| boolean actualResult = BankOcr.validateNumberAccount(incorrectAccount); | ||
|
|
||
| // then: | ||
| assertTrue(!actualResult); |
| final boolean actualResult = EANValidator.checkCorrectLength(eanStringNumber); | ||
|
|
||
| // then: | ||
| assertTrue(!actualResult); |
| final boolean actualResult = EANValidator.validate(eanStringNumber); | ||
|
|
||
| // then: | ||
| assertTrue(!actualResult); |
|
|
||
| // then | ||
| final double expectedResult = 1.5; | ||
| assertEquals(0, expectedResult, actualResult); |
There was a problem hiding this comment.
first argument should be expectedResult and the second argument should be actualResult
| @Test | ||
| public void testRentalEmpty() { | ||
| // given: | ||
| Customer customer = new Customer("Test"); |
There was a problem hiding this comment.
you are repeating this code in all your test
Consider put it in a @before method
| /** | ||
| * Created by Administrator on 7/5/2017. | ||
| */ | ||
| public class MainTest { |
There was a problem hiding this comment.
Do we need this test class?
| /** | ||
| * Created by Administrator on 7/5/2017. | ||
| */ | ||
| public class MovieTest { |
There was a problem hiding this comment.
@AT-03/at-03
Do we need this unit tests?
| @Test | ||
| public void testCalculateAmountWhenTheRentedDaysIsLessThanThree() { | ||
| // given: | ||
| NewRelease newReleaseInstance = new NewRelease("Test"); |
There was a problem hiding this comment.
@AT-03/at-03
what is wrong here?
| */ | ||
| public class RentalTest { | ||
|
|
||
| private Movie movie = new Movie("test") { |
There was a problem hiding this comment.
@AT-03/at-03
what is wrong here?
| * @param numberAccount image of type String. | ||
| * @return <code>true</code> \\ <code>false</code> | ||
| */ | ||
| private static boolean isCorrectLength(final String numberAccount) { |
There was a problem hiding this comment.
you can still refactor this
all katas of the coding.