public void Dispose() { List <DnsRecord> recs = _client.RecordsList(TestZoneName).Result; foreach (DnsRecord rec in recs) { _client.RecordsDelete(TestZoneName, rec.Id).Wait(); } bool deleted = _client.DeleteZone(TestZoneName).Result; if (!deleted) { throw new Exception("Unable to delete " + TestZoneName); } }
public async Task TestMasterZoneCreateMultipleNs() { List <string> nameservers = new List <string> { "google.dk", "test.dk" }; const string name = "multiplens" + TestZoneNameSuffix; // Create Assert.True(await Client.CreateMasterZone(name, nameservers)); // Ensure we have all the NS List <DnsRecord> recs = await Client.RecordsList(name); List <DnsRecord> ns = recs.Where(s => s.Type == RecordType.NS).ToList(); Assert.Equal(nameservers.Count, ns.Count); Assert.True(nameservers.All(s => recs.Any(x => x.Record == s.ToString()))); // Delete zone Assert.True(await Client.DeleteZone(name)); }