forked from JetBrains/swot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SwotTest.kt
59 lines (54 loc) · 3.48 KB
/
SwotTest.kt
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
package swot
import junit.framework.TestCase
class SwotTest : TestCase() {
fun testSwot() {
assertEquals (true , isAcademic("[email protected]"))
assertEquals (true , isAcademic("[email protected]"))
assertEquals (true , isAcademic("[email protected]"))
assertEquals (true , isAcademic("[email protected]"))
assertEquals (true , isAcademic("[email protected]"))
assertEquals (true , isAcademic("[email protected]"))
assertEquals (true , isAcademic("[email protected]"))
assertEquals (true , isAcademic("[email protected]"))
assertEquals (true , isAcademic("[email protected]"))
assertEquals (true , isAcademic("[email protected]"))
assertEquals (false, isAcademic("[email protected]"))
assertEquals (false, isAcademic("[email protected]"))
assertEquals (false, isAcademic("[email protected]"))
assertEquals (false, isAcademic("[email protected]"))
assertEquals (true , isAcademic("stanford.edu"))
assertEquals (true , isAcademic("slac.stanford.edu"))
assertEquals (true , isAcademic("www.stanford.edu"))
assertEquals (true , isAcademic("http://www.stanford.edu"))
assertEquals (true , isAcademic("http://www.stanford.edu:9393"))
assertEquals (true , isAcademic("strath.ac.uk"))
assertEquals (true , isAcademic("soft-eng.strath.ac.uk"))
assertEquals (true , isAcademic("ugr.es"))
assertEquals (true , isAcademic("uottawa.ca"))
assertEquals (true , isAcademic("mother.edu.ru"))
assertEquals (true , isAcademic("ucy.ac.cy"))
assertEquals (false, isAcademic("leerilly.net"))
assertEquals (false, isAcademic("gmail.com"))
assertEquals (false, isAcademic("stanford.edu.com"))
assertEquals (false, isAcademic("strath.ac.uk.com"))
assertEquals (false, isAcademic(""))
assertEquals (false, isAcademic("the"))
assertEquals (true , isAcademic(" stanford.edu"))
assertEquals (true , isAcademic("[email protected] "))
assertEquals (false, isAcademic(" gmail.com "))
assertEquals (true , isAcademic("[email protected]"))
assertEquals (true , isAcademic("[email protected]"))
assertEquals (true , isAcademic("[email protected]"))
assertEquals(false, isAcademic("[email protected]"))
assertEquals(false, isAcademic("[email protected]"))
// Iran sanctions are lifted
assertEquals(true, isAcademic("[email protected]"))
}
fun testSchoolNames() {
assertTrue(findSchoolNames("[email protected]").contains("University of Strathclyde"))
assertTrue(findSchoolNames("[email protected]").contains("uka tarsadia university,bardoli"))
assertEquals("BRG Fadingerstraße Linz, Austria", findSchoolNames("[email protected]").single())
assertEquals("St. Petersburg State University", findSchoolNames("[email protected] ").single())
assertEquals(0, findSchoolNames("[email protected]").size)
}
}