Exemplo n.º 1
0
        public void Data_DerivedClass()
        {
            var a = new ARecord {
                Address = IPAddress.Parse("127.0.0.1")
            };

            Assert.AreNotEqual(0, a.GetData().Length);
        }
        public void MustExist_ResourceRecord()
        {
            var rr = new ARecord
            {
                Name    = "local",
                Class   = DnsClass.IN,
                Address = IPAddress.Parse("127.0.0.0")
            };
            var prerequisites = new UpdatePrerequisiteList()
                                .MustExist(rr);
            var p = prerequisites.First() as ResourceRecord;

            Assert.IsNotNull(p);
            Assert.AreEqual(rr.Class, p.Class);
            Assert.AreEqual(rr.Name, p.Name);
            Assert.AreEqual(TimeSpan.Zero, p.TTL);
            Assert.AreEqual(rr.Type, p.Type);
            Assert.AreEqual(rr.GetDataLength(), p.GetDataLength());
            Assert.IsTrue(rr.GetData().SequenceEqual(p.GetData()));
        }
Exemplo n.º 3
0
        public void DeleteResource()
        {
            var rr = new ARecord
            {
                Name    = "local",
                Class   = DnsClass.IN,
                Address = IPAddress.Parse("127.0.0.0")
            };
            var updates = new UpdateResourceList()
                          .DeleteResource(rr);
            var p = updates.First() as ResourceRecord;

            Assert.IsNotNull(p);
            Assert.AreEqual(DnsClass.None, p.Class);
            Assert.AreEqual(rr.Name, p.Name);
            Assert.AreEqual(TimeSpan.Zero, p.TTL);
            Assert.AreEqual(rr.Type, p.Type);
            Assert.AreEqual(rr.GetDataLength(), p.GetDataLength());
            Assert.IsTrue(rr.GetData().SequenceEqual(p.GetData()));
        }