Skip to content

Commit

Permalink
Added integration test for SetDisableReferral
Browse files Browse the repository at this point in the history
  • Loading branch information
csnitker-godaddy committed May 2, 2023
1 parent 761ee92 commit 8082fc7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions whois_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package whois

import (
"errors"
"strings"
"testing"
"time"

Expand All @@ -34,6 +35,20 @@ func TestVersion(t *testing.T) {
assert.Contains(t, License(), "Apache License")
}

func TestClient_SetDisableReferral(t *testing.T) {
client := NewClient()

resp, err := client.Whois("likexian.com")
assert.Nil(t, err)
assert.Equal(t, strings.Count(resp, "Domain Name: LIKEXIAN.COM"), 2)

client.SetDisableReferral(true)

resp, err = client.Whois("likexian.com")
assert.Nil(t, err)
assert.Equal(t, strings.Count(resp, "Domain Name: LIKEXIAN.COM"), 1)
}

func TestWhoisFail(t *testing.T) {
tests := []struct {
domain string
Expand Down

0 comments on commit 8082fc7

Please sign in to comment.