コード例 #1
0
        public void Stringing()
        {
            var a = new ResourceRecord
            {
                Name = "x.emanon.org",
                Type = DnsType.A
            };

            Assert.AreEqual("x.emanon.org IN A \\# 0", a.ToString());

            a = new ResourceRecord
            {
                Name  = "x.emanon.org",
                Type  = DnsType.A,
                Class = DnsClass.CH
            };
            Assert.AreEqual("x.emanon.org CH A \\# 0", a.ToString());

            a = new ResourceRecord
            {
                Name = "x.emanon.org",
                Type = DnsType.A,
                TTL  = TimeSpan.FromSeconds(123)
            };
            Assert.AreEqual("x.emanon.org 123 IN A \\# 0", a.ToString());
        }
コード例 #2
0
        public void Stringing_UnknownType()
        {
            var a = new ResourceRecord
            {
                Name = "x.emanon.org",
                Type = (DnsType)1234
            };

            Assert.AreEqual("x.emanon.org IN TYPE1234 \\# 0", a.ToString());
        }
コード例 #3
0
        public void Stringing_UnknownClass()
        {
            var a = new ResourceRecord
            {
                Name  = "x.emanon.org",
                Class = (DnsClass)1234,
                Type  = DnsType.A
            };

            Assert.AreEqual("x.emanon.org CLASS1234 A \\# 0", a.ToString());
        }