Skip to main content
added 7 characters in body
Source Link
MaxZoom
  • 321
  • 3
  • 8

The main thing I've noticed is the usage of int type to represent characters. Characters are stored in the memory as numbers but as for testing I would expect to see char in theirits human readable form. For example:

public void randomUpperCaseLetter() {
    char letter = new RandomLetter().generate();
    int upperCaseAAsciiCode = 65;
    int upperCaseZAsciiCode = 90;
    assertTrue(letter >= upperCaseAAsciiCode && letter <= upperCaseZAsciiCode);
}

should be written for clarity as

public void randomUpperCaseLetter() {
    char letter = new RandomLetter().generate();
    assertTrue(letter >= 'A' && letter <= 'Z' );
}

To better test the generating letter functionality, I would call generate method multiple timetimes (possibly in a loop) to generate more letters.

For the second test method, it seems to be unnecessary. The letter 'A' will always have ASCII character code 65 and there is no need to test it.

public void compareCharactersWithAsciiCodes() {
    assertEquals(65, 'A');
    :
}
public void compareCharactersWithAsciiCodes() {
    assertEquals(65, 'A');
    :
}

The main thing I've noticed is the usage of int type to represent characters. Characters are stored in the memory as numbers but as for testing I would expect to see char in their human readable form. For example:

public void randomUpperCaseLetter() {
    char letter = new RandomLetter().generate();
    int upperCaseAAsciiCode = 65;
    int upperCaseZAsciiCode = 90;
    assertTrue(letter >= upperCaseAAsciiCode && letter <= upperCaseZAsciiCode);
}

should be written for clarity as

public void randomUpperCaseLetter() {
    char letter = new RandomLetter().generate();
    assertTrue(letter >= 'A' && letter <= 'Z' );
}

To better test the generating letter functionality, I would call generate method multiple time (possibly in a loop) to generate more letters.

For the second test method, it seems to be unnecessary. The letter 'A' will always have ASCII character code 65 and there is no need to test it.

public void compareCharactersWithAsciiCodes() {
    assertEquals(65, 'A');
    :
}

The main thing I've noticed is the usage of int type to represent characters. Characters are stored in the memory as numbers but as for testing I would expect to see char in its human readable form. For example:

public void randomUpperCaseLetter() {
    char letter = new RandomLetter().generate();
    int upperCaseAAsciiCode = 65;
    int upperCaseZAsciiCode = 90;
    assertTrue(letter >= upperCaseAAsciiCode && letter <= upperCaseZAsciiCode);
}

should be written for clarity as

public void randomUpperCaseLetter() {
    char letter = new RandomLetter().generate();
    assertTrue(letter >= 'A' && letter <= 'Z' );
}

To better test the generating letter functionality, I would call generate method multiple times (possibly in a loop) to generate more letters.

For the second test method, it seems to be unnecessary. The letter 'A' will always have ASCII character code 65 and there is no need to test it.

public void compareCharactersWithAsciiCodes() {
    assertEquals(65, 'A');
    :
}
deleted 4 characters in body
Source Link
MaxZoom
  • 321
  • 3
  • 8

The main thing I've noticed is the usage of int type to represent characters. Characters are stored in the memory as numbers but as for testing I would expect to see char in their human readable form. For example:

public void randomUpperCaseLetter() {
    char letter = new RandomLetter().generate();
    int upperCaseAAsciiCode = 65;
    int upperCaseZAsciiCode = 90;
    assertTrue(letter >= upperCaseAAsciiCode && letter <= upperCaseZAsciiCode);
}

should be written for clarity as

public void randomUpperCaseLetter() {
    char letter = new RandomLetter().generate();
    assertTrue(letter >= 'A' && letter <= 'Z' );
}

To better test the letter generationgenerating letter functionality, I would add more occurrences to call abovegenerate method multiple time (possibly putin a loop) to generate more letters).

For the second test method, it seems to be unnecessary. The letter 'A' will always have ASCII character code 65 and there is no need to test it.

public void compareCharactersWithAsciiCodes() {
    assertEquals(65, 'A');
    :
}

The main thing I've noticed is the usage of int type to represent characters. Characters are stored in the memory as numbers but as for testing I would expect to see char in their human readable form. For example:

public void randomUpperCaseLetter() {
    char letter = new RandomLetter().generate();
    int upperCaseAAsciiCode = 65;
    int upperCaseZAsciiCode = 90;
    assertTrue(letter >= upperCaseAAsciiCode && letter <= upperCaseZAsciiCode);
}

should be written for clarity as

public void randomUpperCaseLetter() {
    char letter = new RandomLetter().generate();
    assertTrue(letter >= 'A' && letter <= 'Z' );
}

To better test the letter generation functionality, I would add more occurrences to call above method (possibly put a loop to generate more letters).

For the second test method, it seems to be unnecessary. The letter 'A' will always have ASCII character code 65 and there is no need to test it.

public void compareCharactersWithAsciiCodes() {
    assertEquals(65, 'A');
    :
}

The main thing I've noticed is the usage of int type to represent characters. Characters are stored in the memory as numbers but as for testing I would expect to see char in their human readable form. For example:

public void randomUpperCaseLetter() {
    char letter = new RandomLetter().generate();
    int upperCaseAAsciiCode = 65;
    int upperCaseZAsciiCode = 90;
    assertTrue(letter >= upperCaseAAsciiCode && letter <= upperCaseZAsciiCode);
}

should be written for clarity as

public void randomUpperCaseLetter() {
    char letter = new RandomLetter().generate();
    assertTrue(letter >= 'A' && letter <= 'Z' );
}

To better test the generating letter functionality, I would call generate method multiple time (possibly in a loop) to generate more letters.

For the second test method, it seems to be unnecessary. The letter 'A' will always have ASCII character code 65 and there is no need to test it.

public void compareCharactersWithAsciiCodes() {
    assertEquals(65, 'A');
    :
}
added 7 characters in body
Source Link
MaxZoom
  • 321
  • 3
  • 8

The main thing I've noticed is the usage of int type to represent characters. Characters are storestored in the memory as numbernumbers but as for testing I would expect to see char in their human readable form. For example:

public void randomUpperCaseLetter() {
    char letter = new RandomLetter().generate();
    int upperCaseAAsciiCode = 65;
    int upperCaseZAsciiCode = 90;
    assertTrue(letter >= upperCaseAAsciiCode && letter <= upperCaseZAsciiCode);
}

should be written for clarity as

public void randomUpperCaseLetter() {
    char letter = new RandomLetter().generate();
    assertTrue(letter >= 'A' && letter <= 'Z' );
}

To better test the letter letter generation functionality, I would add more occurrences to call above method (possibly put a loop to generate more letters).

For the second test method, it seems to be unnecessary. The letter 'A' will always have ASCII character code 65 and there is no need to test it.

public void compareCharactersWithAsciiCodes() {
    assertEquals(65, 'A');
    :
}

The main thing I've noticed is the usage of int type to represent characters. Characters are store in the memory as number but as for testing I would expect to see char in their human readable form. For example:

public void randomUpperCaseLetter() {
    char letter = new RandomLetter().generate();
    int upperCaseAAsciiCode = 65;
    int upperCaseZAsciiCode = 90;
    assertTrue(letter >= upperCaseAAsciiCode && letter <= upperCaseZAsciiCode);
}

should be written for clarity as

public void randomUpperCaseLetter() {
    char letter = new RandomLetter().generate();
    assertTrue(letter >= 'A' && letter <= 'Z' );
}

To better test the letter generation functionality, I would add more occurrences to above method (possibly put a loop to generate more letters).

For the second test method, it seems to be unnecessary. The letter 'A' will always have ASCII character code 65 and there is no need to test it.

public void compareCharactersWithAsciiCodes() {
    assertEquals(65, 'A');
    :
}

The main thing I've noticed is the usage of int type to represent characters. Characters are stored in the memory as numbers but as for testing I would expect to see char in their human readable form. For example:

public void randomUpperCaseLetter() {
    char letter = new RandomLetter().generate();
    int upperCaseAAsciiCode = 65;
    int upperCaseZAsciiCode = 90;
    assertTrue(letter >= upperCaseAAsciiCode && letter <= upperCaseZAsciiCode);
}

should be written for clarity as

public void randomUpperCaseLetter() {
    char letter = new RandomLetter().generate();
    assertTrue(letter >= 'A' && letter <= 'Z' );
}

To better test the letter generation functionality, I would add more occurrences to call above method (possibly put a loop to generate more letters).

For the second test method, it seems to be unnecessary. The letter 'A' will always have ASCII character code 65 and there is no need to test it.

public void compareCharactersWithAsciiCodes() {
    assertEquals(65, 'A');
    :
}
Source Link
MaxZoom
  • 321
  • 3
  • 8
Loading