-
Notifications
You must be signed in to change notification settings - Fork 3
/
domain_test.go
45 lines (39 loc) · 842 Bytes
/
domain_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
package labstack
import (
"testing"
"github.com/labstack/labstack-go/domain"
"github.com/stretchr/testify/assert"
)
func TestClient_DNS(t *testing.T) {
res, err := ds.DNS(&domain.DNSRequest{
Type: "A",
Domain: "twilio.com",
})
if assert.Nil(t, err) {
assert.NotZero(t, len(res.Records))
}
}
func TestClient_Search(t *testing.T) {
res, err := ds.Search(&domain.SearchRequest{
Q: "twilio",
})
if assert.Nil(t, err) {
assert.NotZero(t, len(res.Results))
}
}
func TestClient_Status(t *testing.T) {
res, err := ds.Status(&domain.StatusRequest{
Domain: "twilio.com",
})
if assert.Nil(t, err) {
assert.Equal(t, "unavailable", res.Result)
}
}
func TestClient_Whois(t *testing.T) {
res, err := ds.Whois(&domain.WhoisRequest{
Domain: "twilio.com",
})
if assert.Nil(t, err) {
assert.NotEmpty(t, res.Raw)
}
}