| 1 | package dns |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | ) |
| 6 | |
| 7 | func TestAddDomainRecord(t *testing.T) { |
| 8 | client := NewTestClient() |
| 9 | addDomainRecordArgs := AddDomainRecordArgs{ |
| 10 | DomainName: TestDomainName, |
| 11 | RR: "testaddrecord", |
| 12 | Type: ARecord, |
| 13 | Value: "8.8.8.8", |
| 14 | } |
| 15 | response, err := client.AddDomainRecord(&addDomainRecordArgs) |
| 16 | if err == nil { |
| 17 | t.Logf("AddDomainRecord: testaddr for domain: %s Success, %v", |
| 18 | TestDomainName, response) |
| 19 | |
| 20 | deleteDomainRecordArgs := DeleteDomainRecordArgs{ |
| 21 | RecordId: response.RecordId, |
| 22 | } |
| 23 | client.DeleteDomainRecord(&deleteDomainRecordArgs) |
| 24 | } else { |
| 25 | t.Errorf("Failed to AddDomainRecord: testaddr for domain: %s", TestDomainName) |
| 26 | } |
| 27 | } |