• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

wmixvideo / nfe / #6656

20 Jun 2016 11:31AM UTC coverage: 79.109% (+2.5%) from 76.628%
#6656

push

travis-ci

fincatto
Gerador de chave gerando codigo randomico, quando nao informado.

3 of 3 new or added lines in 1 file covered. (100.0%)

352 existing lines in 69 files now uncovered.

4741 of 5993 relevant lines covered (79.11%)

50.57 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

86.67
/src/main/java/com/fincatto/nfe310/validadores/IntegerValidador.java
1
package com.fincatto.nfe310.validadores;
2

3
import java.text.MessageFormat;
4

5
public class IntegerValidador {
6

7
    private IntegerValidador() {
×
8
    }
×
9

10
    public static void tamanho4(final Integer valor) {
11
        IntegerValidador.limite(valor, 9999);
51✔
12
    }
49✔
13

14
    public static void tamanho7(final Integer valor) {
15
        IntegerValidador.limite(valor, 9999999);
2✔
16
    }
1✔
17

18
    public static void exatamente7(final Integer valor) {
19
        IntegerValidador.intervalo(valor, 1000000, 9999999);
29✔
20
    }
27✔
21

22
    public static void exatamente4(final int valor) {
23
        IntegerValidador.intervalo(valor, 1000, 9999);
60✔
24
    }
56✔
25

26
    public static void tamanho3(final int valor) {
27
        IntegerValidador.limite(valor, 999);
213✔
28
    }
208✔
29

30
    public static void tamanho3maximo990(final int valor) {
31
        IntegerValidador.limite(valor, 990);
38✔
32
    }
37✔
33

34
    public static void exatamente6(final Integer valor) {
UNCOV
35
        IntegerValidador.intervalo(valor, 100000, 999999);
×
UNCOV
36
    }
×
37

38
    public static void tamanho6(final Integer valor) {
39
        IntegerValidador.limite(valor, 999999);
70✔
40
    }
68✔
41

42
    public static void exatamente1(final Integer valor) {
43
        IntegerValidador.limite(valor, 9);
57✔
44
    }
56✔
45

46
    public static void tamanho1a2(final int valor) {
47
        IntegerValidador.intervalo(valor, 1, 99);
23✔
48
    }
23✔
49

50
    public static void exatamente2(final Integer valor) {
51
        IntegerValidador.intervalo(valor, 10, 99);
15✔
52
    }
13✔
53

54
    private static void limite(final Integer valor, final int maximo) {
55
        if (valor > maximo) {
431✔
56
            throw new NumberFormatException("Valor extrapolou o tamanho do campo");
12✔
57
        }
58
    }
419✔
59

60
    private static void intervalo(final Integer valor, final int minimo, final int maximo) {
61
        if (valor < minimo || valor > maximo) {
127✔
62
            throw new NumberFormatException(MessageFormat.format("Valor tem tamanho fora do intervalo de [{0}-{1}]", minimo, maximo));
8✔
63
        }
64
    }
119✔
65
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc