forked from exercism/vbnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAnagramTest.vb
86 lines (76 loc) · 2.71 KB
/
AnagramTest.vb
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
Imports NUnit.Framework
<TestFixture>
Public Class AnagramTest
<Test>
Public Sub NoMatches()
Dim detector = New Anagram("diaper")
Dim words = New String() {"hello", "world", "zombies", "pants"}
Dim results = New String() {}
Assert.That(detector.Match(words), [Is].EqualTo(results))
End Sub
<Ignore>
<Test>
Public Sub DetectSimpleAnagram()
Dim detector = New Anagram("ant")
Dim words = New String() {"tan", "stand", "at"}
Dim results = New String() {"tan"}
Assert.That(detector.Match(words), [Is].EqualTo(results))
End Sub
<Ignore>
<Test>
Public Sub DetectMultipleAnagrams()
Dim detector = New Anagram("master")
Dim words = New String() {"stream", "pigeon", "maters"}
Dim results = New String() {"maters", "stream"}
Assert.That(detector.Match(words), [Is].EqualTo(results))
End Sub
<Ignore>
<Test>
Public Sub DoesNotConfuseDifferentDuplicates()
Dim detector = New Anagram("galea")
Dim words = New String() {"eagle"}
Dim results = New String() {}
Assert.That(detector.Match(words), [Is].EqualTo(results))
End Sub
<Ignore>
<Test>
Public Sub IdenticalWordIsNotAnagram()
Dim detector = New Anagram("corn")
Dim words = New String() {"corn", "dark", "Corn", "rank", "CORN", "cron",
"park"}
Dim results = New String() {"cron"}
Assert.That(detector.Match(words), [Is].EqualTo(results))
End Sub
<Ignore>
<Test>
Public Sub EliminateAnagramsWithSameChecksum()
Dim detector = New Anagram("mass")
Dim words = New String() {"last"}
Dim results = New String(-1) {}
Assert.That(detector.Match(words), [Is].EqualTo(results))
End Sub
<Ignore>
<Test>
Public Sub EliminateAnagramSubsets()
Dim detector = New Anagram("good")
Dim words = New String() {"dog", "goody"}
Dim results = New String(-1) {}
Assert.That(detector.Match(words), [Is].EqualTo(results))
End Sub
<Ignore>
<Test>
Public Sub DetectAnagrams()
Dim detector = New Anagram("allergy")
Dim words = New String() {"gallery", "ballerina", "regally", "clergy", "largely", "leading"}
Dim results = New String() {"gallery", "largely", "regally"}
Assert.That(detector.Match(words), [Is].EqualTo(results))
End Sub
<Ignore>
<Test>
Public Sub AnagramsAreCaseInsensitive()
Dim detector = New Anagram("Orchestra")
Dim words = New String() {"cashregister", "Carthorse", "radishes"}
Dim results = New String() {"Carthorse"}
Assert.That(detector.Match(words), [Is].EqualTo(results))
End Sub
End Class