-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalidator-sedol-tests.red
More file actions
64 lines (57 loc) · 1.37 KB
/
validator-sedol-tests.red
File metadata and controls
64 lines (57 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
Red [
Title: "SEDOL validator tests"
Description: "Testing functionality of SEDOL validator using RedUnit framework"
Author: "Mateusz Palichleb"
File: %validator-sedol-tests.red
]
context [
setup: func [
"Initialize/Reload context before each test"
] [
do %../src/validator.red
]
/local valid-sedol-numbers: [
"B0YBKJ7"
"B0YBLH2"
"B0YBKL9"
"B0YBKT7"
"B0WNLY7"
"B0YBKR5"
"B000300"
"7108899"
"5579107"
"5852842"
"4065663"
"2282765"
"0263494"
]
/local invalid-sedol-numbers: [
"71-08-899"
"710 889"
"7108899X"
"0123456"
"B0WWWWF"
]
test-valid-sedol: func [
"Testing only valid SEDOL numbers"
] [
foreach sedol valid-sedol-numbers [
; for debugging
;if (false == valid/sedol sedol) [
; print rejoin [ "Failure: " sedol ]
;]
tester/assert-true valid/sedol sedol
]
]
test-invalid-sedol: func [
"Testing incorrect SEDOL numbers"
] [
foreach sedol invalid-sedol-numbers [
; for debugging
;if (true == valid/sedol sedol) [
; print rejoin [ "Failure: " sedol ]
;]
tester/assert-false valid/sedol sedol
]
]
]