Conversation
Codecov Report
@@ Coverage Diff @@
## develop #25 +/- ##
============================================
+ Coverage 94.78% 95.19% +0.4%
- Complexity 138 207 +69
============================================
Files 26 39 +13
Lines 307 458 +151
Branches 50 75 +25
============================================
+ Hits 291 436 +145
- Misses 5 6 +1
- Partials 11 16 +5
Continue to review full report at Codecov.
|
| boolean actualResult = BankOCR.validAccountNumbers(value); | ||
|
|
||
| // then: | ||
| assertTrue(!actualResult); |
| */ | ||
| @Test | ||
| public void testWhenSentenceIsEmpty() { | ||
| CadInv cadI = new CadInv(); |
|
|
||
| // then | ||
| final boolean expectedResult = true; | ||
| assertEquals(actualResult, expectedResult); |
| */ | ||
| @Test | ||
| public void testWhenSentenceISEmpty() { | ||
| CheckSum cs = new CheckSum(); |
| */ | ||
| @Test | ||
| public void testPromWhenHave5Elements() { | ||
| Prom p = new Prom(); |
| @Test | ||
| public void testCalculateAmountWhenTheRentedDaysIsLessThanThree() { | ||
| // given: | ||
| Children childrenInstance = new Children("Toy Story"); |
There was a problem hiding this comment.
Movie childrenInstance = new Children("Toy Story");
@before method
|
@NandoOU |
| */ | ||
| public final class StringInv { | ||
|
|
||
| static final int CANT_MAJOR = 5; |
| * @return String to get the all numbers. | ||
| */ | ||
| public static String parseDigit(final String[] cad) { | ||
| String res = ""; |
There was a problem hiding this comment.
Do we need this variable?
| */ | ||
| @Override | ||
| public int calculateFrequentRenterPoints(final int daysRented) { | ||
| return 1; |
| * @return the string. | ||
| */ | ||
| public String generateDetail() { | ||
| StringBuffer result = new StringBuffer(); |
There was a problem hiding this comment.
Consider using a StringBuilder
| StringBuffer result = new StringBuffer(); | ||
| result.append("Rental Record for " + getName() + "\n"); | ||
| for (Rental rental : rentalsCustomer) { | ||
| result.append("\t" + rental.getMovie().getTitle() + "\t"); |
There was a problem hiding this comment.
Don't concatenate strings using +
Consider using a String format
| */ | ||
| public class AverageTest { | ||
|
|
||
| private Average p; |
| }; | ||
|
|
||
| // when: | ||
| String actualResult = BankOCR.parseDigit(data); |
| String actualResult = BankOCR.parseDigit(data); | ||
|
|
||
| // then: | ||
| String expectedResult = "0123456789"; |
|
|
||
| // then | ||
| final boolean expectedResult = true; | ||
| assertEquals(actualResult, expectedResult); |
|
|
||
| // then | ||
| final boolean expectedResult = false; | ||
| assertEquals(actualResult, expectedResult); |
|
|
||
| // 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 the actualResult
|
|
||
| // then: | ||
| final double expectedResult = 10.5; | ||
| assertEquals(0, expectedResult, actualResult); |
| * @return boolean valor if is valid account number. | ||
| */ | ||
| public static boolean validAccountNumbers(final String input) { | ||
| int suma = 0; |
| */ | ||
| public class NewRelease extends Movie { | ||
|
|
||
| private static final int LIMITNEWCHILD = 3; |
| /** | ||
| * @param daysRented param. | ||
| * @return double value. | ||
| */ |
|
|
||
| private static final double PRICE = 1.5; | ||
|
|
||
| private static final int LIMITREGULAR = 2; |
| /** | ||
| * @param daysRented param. | ||
| * @return Children value. | ||
| */ |
| /** | ||
| * @param daysRented param. | ||
| * @return double value. | ||
| */ |
| /** | ||
| * @param daysRented param. | ||
| * @return int value. | ||
| */ |
| */ | ||
| @Override | ||
| public int calculateFrequentRenterPoints(final int daysRented) { | ||
| return 1; |
| import java.lang.reflect.Constructor; | ||
| import java.lang.reflect.Modifier; | ||
|
|
||
| import static junit.framework.TestCase.assertTrue; |
There was a problem hiding this comment.
import static org.junit.Assert.assertTrue; ?
| @Test | ||
| public void testToGetNumber() { | ||
| // given: | ||
| String[] data = { |
| String data = "021453789"; | ||
|
|
||
| // when: | ||
| String actualResult = BankOCR.accountStatus(data); |
|
|
||
| // then | ||
| final double expectedResult = 1.5; | ||
| assertEquals(0, expectedResult, actualResult); |
Coding Exercises