-
Notifications
You must be signed in to change notification settings - Fork 159
/
misc_test.go
51 lines (36 loc) · 1.04 KB
/
misc_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
50
51
package emailverifier
import (
"testing"
"github.com/stretchr/testify/assert"
)
var verifier = NewVerifier().EnableSMTPCheck()
func TestIsFreeDomain_True(t *testing.T) {
domain := "gmail.com"
isFreeDomain := verifier.IsFreeDomain(domain)
assert.True(t, isFreeDomain)
}
func TestCheckNotFreeDomain_False(t *testing.T) {
domain := "github.com"
isFreeDomain := verifier.IsFreeDomain(domain)
assert.False(t, isFreeDomain)
}
func TestIsDisposableDomain_True(t *testing.T) {
domain := "dbbd8.club"
isDisposable := verifier.IsDisposable(domain)
assert.True(t, isDisposable)
}
func TestIsDisposableDomain_False(t *testing.T) {
domain := "gmail.com"
isDisposable := verifier.IsDisposable(domain)
assert.False(t, isDisposable)
}
func TestIsRoleAccount_True(t *testing.T) {
username := "administrator"
isRoleAccount := verifier.IsRoleAccount(username)
assert.True(t, isRoleAccount)
}
func TestIsRoleAccount_False(t *testing.T) {
username := "normal_user"
isRoleAccount := verifier.IsRoleAccount(username)
assert.False(t, isRoleAccount)
}