public ResourceRecord Visit(SrvResourceRecord record, DnsZoneFormatterContext context) { context.WritePreference(record.Priority); context.WritePreference(record.Weight); context.WritePreference(record.Port); context.WriteAndCompressDomainName(record.Target); return(record); }
public ResourceRecord Visit(SrvResourceRecord record, DnsZoneParseContext context) { record.Priority = context.ReadPreference(); record.Weight = context.ReadPreference(); record.Port = context.ReadPreference(); record.Target = context.ReadAndResolveDomainName(); return(record); }
public void NameTest() { var record = new SrvResourceRecord(); record.Name = "_foobar._tcp.example.com"; Assert.AreEqual("foobar", record.Service); Assert.AreEqual("tcp", record.Protocol); Assert.AreEqual("example.com", record.Host); record.Service = "test"; Assert.AreEqual("_test._tcp.example.com", record.Name); record.Protocol = "udp"; Assert.AreEqual("_test._udp.example.com", record.Name); record.Host = "vcap.me"; Assert.AreEqual("_test._udp.vcap.me", record.Name); }