|
|
@@ -18,73 +18,73 @@ public class LuhnValidatorTest {
|
|
18
|
18
|
assertFalse(luhnValidator.isValid("1"));
|
|
19
|
19
|
}
|
|
20
|
20
|
|
|
21
|
|
- @Ignore
|
|
|
21
|
+ @Ignore("Remove to run test")
|
|
22
|
22
|
@Test
|
|
23
|
23
|
public void testThatTheStringConsistingOfASingleZeroIsInvalid() {
|
|
24
|
24
|
assertFalse(luhnValidator.isValid("0"));
|
|
25
|
25
|
}
|
|
26
|
26
|
|
|
27
|
|
- @Ignore
|
|
|
27
|
+ @Ignore("Remove to run test")
|
|
28
|
28
|
@Test
|
|
29
|
29
|
public void testThatASimpleValidNumberIsIdentifiedAsValid() {
|
|
30
|
30
|
assertTrue(luhnValidator.isValid(" 5 9 "));
|
|
31
|
31
|
}
|
|
32
|
32
|
|
|
33
|
|
- @Ignore
|
|
|
33
|
+ @Ignore("Remove to run test")
|
|
34
|
34
|
@Test
|
|
35
|
35
|
public void testThatAValidCanadianSocialInsuranceNumberIsIdentifiedAsValidV1() {
|
|
36
|
36
|
assertTrue(luhnValidator.isValid("046 454 286"));
|
|
37
|
37
|
}
|
|
38
|
38
|
|
|
39
|
|
- @Ignore
|
|
|
39
|
+ @Ignore("Remove to run test")
|
|
40
|
40
|
@Test
|
|
41
|
41
|
public void testThatAValidCanadianSocialInsuranceNumberIsIdentifiedAsValidV2() {
|
|
42
|
42
|
assertTrue(luhnValidator.isValid("055 444 285"));
|
|
43
|
43
|
}
|
|
44
|
44
|
|
|
45
|
|
- @Ignore
|
|
|
45
|
+ @Ignore("Remove to run test")
|
|
46
|
46
|
@Test
|
|
47
|
47
|
public void testThatAnInvalidCanadianSocialInsuranceNumberIsIdentifiedAsInvalid() {
|
|
48
|
48
|
assertFalse(luhnValidator.isValid("046 454 287"));
|
|
49
|
49
|
}
|
|
50
|
50
|
|
|
51
|
|
- @Ignore
|
|
|
51
|
+ @Ignore("Remove to run test")
|
|
52
|
52
|
@Test
|
|
53
|
53
|
public void testThatAnInvalidCreditCardIsIdentifiedAsInvalid() {
|
|
54
|
54
|
assertFalse(luhnValidator.isValid("8273 1232 7352 0569"));
|
|
55
|
55
|
}
|
|
56
|
56
|
|
|
57
|
|
- @Ignore
|
|
|
57
|
+ @Ignore("Remove to run test")
|
|
58
|
58
|
@Test
|
|
59
|
59
|
public void testThatAddingANonDigitCharacterToAValidStringInvalidatesTheString() {
|
|
60
|
60
|
assertFalse(luhnValidator.isValid("046a 454 286"));
|
|
61
|
61
|
}
|
|
62
|
62
|
|
|
63
|
|
- @Ignore
|
|
|
63
|
+ @Ignore("Remove to run test")
|
|
64
|
64
|
@Test
|
|
65
|
65
|
public void testThatStringContainingPunctuationIsInvalid() {
|
|
66
|
66
|
assertFalse(luhnValidator.isValid("055-444-285"));
|
|
67
|
67
|
}
|
|
68
|
68
|
|
|
69
|
|
- @Ignore
|
|
|
69
|
+ @Ignore("Remove to run test")
|
|
70
|
70
|
@Test
|
|
71
|
71
|
public void testThatStringContainingSymbolsIsInvalid() {
|
|
72
|
72
|
assertFalse(luhnValidator.isValid("055£ 444$ 285"));
|
|
73
|
73
|
}
|
|
74
|
74
|
|
|
75
|
|
- @Ignore
|
|
|
75
|
+ @Ignore("Remove to run test")
|
|
76
|
76
|
@Test
|
|
77
|
77
|
public void testThatTheStringConsistingOfASpaceAndASingleZeroIsInvalid() {
|
|
78
|
78
|
assertFalse(luhnValidator.isValid(" 0"));
|
|
79
|
79
|
}
|
|
80
|
80
|
|
|
81
|
|
- @Ignore
|
|
|
81
|
+ @Ignore("Remove to run test")
|
|
82
|
82
|
@Test
|
|
83
|
83
|
public void testThatStringContainingMultipleZerosIsValid() {
|
|
84
|
84
|
assertTrue(luhnValidator.isValid(" 00000"));
|
|
85
|
85
|
}
|
|
86
|
86
|
|
|
87
|
|
- @Ignore
|
|
|
87
|
+ @Ignore("Remove to run test")
|
|
88
|
88
|
@Test
|
|
89
|
89
|
public void testThatDoublingNineIsHandledCorrectly() {
|
|
90
|
90
|
assertTrue(luhnValidator.isValid("091"));
|