public void Terminates_With_Null_Byte_On_Valid_Name() { var name = new DnsName("test.local"); var result = name.ToByteArray(); Assert.That(result.Last(), Is.EqualTo((byte)0)); }
public void Returns_Correctly_For_Two_Label_Name() { var name = new DnsName("host.com"); var result = name.ToByteArray(); Assert.That(result.Length, Is.EqualTo(10)); for (int i = 0; i < host_dot_com_dnsname.Length; i++) { Assert.That(result[i], Is.EqualTo(host_dot_com_dnsname[i])); } }