Exemple #1
0
        public void Equality()
        {
            var a = new SOARecord
            {
                Name         = "owner-name",
                PrimaryName  = "emanaon.org",
                Mailbox      = "hostmaster.emanon.org",
                SerialNumber = 1,
                Refresh      = TimeSpan.FromDays(1),
                Retry        = TimeSpan.FromMinutes(20),
                Expire       = TimeSpan.FromDays(7 * 3),
                Minimum      = TimeSpan.FromHours(2)
            };
            var b = new SOARecord
            {
                Name         = "owner-name",
                PrimaryName  = "emanaon.org",
                Mailbox      = "hostmaster-x.emanon.org",
                SerialNumber = 1,
                Refresh      = TimeSpan.FromDays(1),
                Retry        = TimeSpan.FromMinutes(20),
                Expire       = TimeSpan.FromDays(7 * 3),
                Minimum      = TimeSpan.FromHours(2)
            };

            Assert.IsTrue(a.Equals(a));
            Assert.IsFalse(a.Equals(b));
            Assert.IsFalse(a.Equals(null));
        }
Exemple #2
0
        public void Roundtrip_Master()
        {
            var a = new SOARecord
            {
                Name         = "owner-name",
                PrimaryName  = "emanaon.org",
                Mailbox      = "hostmaster.emanon.org",
                SerialNumber = 1,
                Refresh      = TimeSpan.FromDays(1),
                Retry        = TimeSpan.FromMinutes(20),
                Expire       = TimeSpan.FromDays(7 * 3),
                Minimum      = TimeSpan.FromHours(2)
            };
            var b = (SOARecord) new ResourceRecord().Read(a.ToString());

            Assert.AreEqual(a.Name, b.Name);
            Assert.AreEqual(a.Class, b.Class);
            Assert.AreEqual(a.Type, b.Type);
            Assert.AreEqual(a.TTL, b.TTL);
            Assert.AreEqual(a.PrimaryName, b.PrimaryName);
            Assert.AreEqual(a.Mailbox, b.Mailbox);
            Assert.AreEqual(a.SerialNumber, b.SerialNumber);
            Assert.AreEqual(a.Retry, b.Retry);
            Assert.AreEqual(a.Expire, b.Expire);
            Assert.AreEqual(a.Refresh, b.Refresh);
            Assert.AreEqual(a.Minimum, b.Minimum);
        }