| 1 | package dnsimplescip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/ |
| 2 | |
| 3 | import ( |
| 4 | "contextscip-go gomod github.com/golang/go/src go1.21 context/" |
| 5 | "ioscip-go gomod github.com/golang/go/src go1.21 io/" |
| 6 | "net/httpscip-go gomod github.com/golang/go/src go1.21 `net/http`/" |
| 7 | "testingscip-go gomod github.com/golang/go/src go1.21 testing/" |
| 8 | |
| 9 | "github.com/stretchr/testify/assertscip-go gomod github.com/stretchr/testify v1.9.0 `github.com/stretchr/testify/assert`/" |
| 10 | ) |
| 11 | |
| 12 | func TestVanityNameServers_vanityNameServerPathscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/TestVanityNameServers_vanityNameServerPath().(t *testingscip-go gomod github.com/golang/go/src go1.21 testing/.Tscip-go gomod github.com/golang/go/src go1.21 testing/T#) { |
| 13 | assertscip-go gomod github.com/stretchr/testify v1.9.0 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.9.0 `github.com/stretchr/testify/assert`/Equal().(t, "/1010/vanity/example.com", vanityNameServerPathscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/vanityNameServerPath().("1010", "example.com")) |
| 14 | } |
| 15 | |
| 16 | func TestVanityNameServersService_EnableVanityNameServersscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/TestVanityNameServersService_EnableVanityNameServers().(t *testingscip-go gomod github.com/golang/go/src go1.21 testing/.Tscip-go gomod github.com/golang/go/src go1.21 testing/T#) { |
| 17 | setupMockServerscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/setupMockServer().() |
| 18 | defer teardownMockServerscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/teardownMockServer().() |
| 19 | |
| 20 | muxscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/mux..HandleFuncscip-go gomod github.com/golang/go/src go1.21 `net/http`/ServeMux#HandleFunc().("/v2/1010/vanity/example.com", func(w httpscip-go gomod github.com/golang/go/src go1.21 `net/http`/.ResponseWriterscip-go gomod github.com/golang/go/src go1.21 `net/http`/ResponseWriter#, r *httpscip-go gomod github.com/golang/go/src go1.21 `net/http`/.Requestscip-go gomod github.com/golang/go/src go1.21 `net/http`/Request#) { |
| 21 | httpResponse := httpResponseFixturescip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/httpResponseFixture().(t, "/api/enableVanityNameServers/success.http") |
| 22 | |
| 23 | testMethodscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/testMethod().(t, r, "PUT") |
| 24 | testHeadersscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/testHeaders().(t, r) |
| 25 | |
| 26 | w.WriteHeaderscip-go gomod github.com/golang/go/src go1.21 `net/http`/ResponseWriter#WriteHeader().(httpResponse.StatusCodescip-go gomod github.com/golang/go/src go1.21 `net/http`/Response#StatusCode.) |
| 27 | _, _ = ioscip-go gomod github.com/golang/go/src go1.21 io/.Copyscip-go gomod github.com/golang/go/src go1.21 io/Copy().(w, httpResponse.Bodyscip-go gomod github.com/golang/go/src go1.21 `net/http`/Response#Body.) |
| 28 | }) |
| 29 | |
| 30 | vanityNameServerResponse, err := clientscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/client..VanityNameServersscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/Client#VanityNameServers..EnableVanityNameServersscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/VanityNameServersService#EnableVanityNameServers().(contextscip-go gomod github.com/golang/go/src go1.21 context/.Backgroundscip-go gomod github.com/golang/go/src go1.21 context/Background().(), "1010", "example.com") |
| 31 | |
| 32 | assertscip-go gomod github.com/stretchr/testify v1.9.0 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.9.0 `github.com/stretchr/testify/assert`/NoError().(t, err) |
| 33 | delegation := vanityNameServerResponse.Datascip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/VanityNameServerResponse#Data.[0].Namescip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/VanityNameServer#Name. |
| 34 | wantSingle := "ns1.example.com" |
| 35 | assertscip-go gomod github.com/stretchr/testify v1.9.0 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.9.0 `github.com/stretchr/testify/assert`/Equal().(t, wantSingle, delegation) |
| 36 | } |
| 37 | |
| 38 | func TestVanityNameServersService_DisableVanityNameServersscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/TestVanityNameServersService_DisableVanityNameServers().(t *testingscip-go gomod github.com/golang/go/src go1.21 testing/.Tscip-go gomod github.com/golang/go/src go1.21 testing/T#) { |
| 39 | setupMockServerscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/setupMockServer().() |
| 40 | defer teardownMockServerscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/teardownMockServer().() |
| 41 | |
| 42 | muxscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/mux..HandleFuncscip-go gomod github.com/golang/go/src go1.21 `net/http`/ServeMux#HandleFunc().("/v2/1010/vanity/example.com", func(w httpscip-go gomod github.com/golang/go/src go1.21 `net/http`/.ResponseWriterscip-go gomod github.com/golang/go/src go1.21 `net/http`/ResponseWriter#, r *httpscip-go gomod github.com/golang/go/src go1.21 `net/http`/.Requestscip-go gomod github.com/golang/go/src go1.21 `net/http`/Request#) { |
| 43 | httpResponse := httpResponseFixturescip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/httpResponseFixture().(t, "/api/disableVanityNameServers/success.http") |
| 44 | |
| 45 | testMethodscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/testMethod().(t, r, "DELETE") |
| 46 | testHeadersscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/testHeaders().(t, r) |
| 47 | |
| 48 | w.WriteHeaderscip-go gomod github.com/golang/go/src go1.21 `net/http`/ResponseWriter#WriteHeader().(httpResponse.StatusCodescip-go gomod github.com/golang/go/src go1.21 `net/http`/Response#StatusCode.) |
| 49 | _, _ = ioscip-go gomod github.com/golang/go/src go1.21 io/.Copyscip-go gomod github.com/golang/go/src go1.21 io/Copy().(w, httpResponse.Bodyscip-go gomod github.com/golang/go/src go1.21 `net/http`/Response#Body.) |
| 50 | }) |
| 51 | |
| 52 | _, err := clientscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/client..VanityNameServersscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/Client#VanityNameServers..DisableVanityNameServersscip-go gomod github.com/dnsimple/dnsimple-go . `github.com/dnsimple/dnsimple-go/dnsimple`/VanityNameServersService#DisableVanityNameServers().(contextscip-go gomod github.com/golang/go/src go1.21 context/.Backgroundscip-go gomod github.com/golang/go/src go1.21 context/Background().(), "1010", "example.com") |
| 53 | |
| 54 | assertscip-go gomod github.com/stretchr/testify v1.9.0 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.9.0 `github.com/stretchr/testify/assert`/NoError().(t, err) |
| 55 | } |