-
Notifications
You must be signed in to change notification settings - Fork 161
/
suggestion_test.go
49 lines (35 loc) · 987 Bytes
/
suggestion_test.go
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
package emailverifier
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestSuggestDomainOK_HitExactDomain(t *testing.T) {
domain := "gmail.com"
ret := verifier.SuggestDomain(domain)
assert.Equal(t, "", ret)
}
func TestSuggestDomainOK_NullString(t *testing.T) {
domain := ""
ret := verifier.SuggestDomain(domain)
assert.Equal(t, "", ret)
}
func TestSuggestDomainOK_SimilarDomain1(t *testing.T) {
domain := "gmaii.com"
ret := verifier.SuggestDomain(domain)
assert.Equal(t, "gmail.com", ret)
}
func TestSuggestDomainOK_SimilarDomain2(t *testing.T) {
domain := "gmai.com"
ret := verifier.SuggestDomain(domain)
assert.Equal(t, "gmail.com", ret)
}
func TestSuggestDomainOK_TLD(t *testing.T) {
domain := "gmail.edd"
ret := verifier.SuggestDomain(domain)
assert.Equal(t, "gmail.edu", ret)
}
func TestSuggestDomainOK_SLD(t *testing.T) {
domain := "homail.aftership"
ret := verifier.SuggestDomain(domain)
assert.Equal(t, "hotmail.aftership", ret)
}