Inheritance: EppResponse
        public void TestDomainsSuspendedNotification()
        {
            byte[] input = File.ReadAllBytes("DomainsSuspendedNotification.xml");
            var response = new PollResponse(input);

            Assert.AreEqual("1301", response.Code);
            Assert.AreEqual("Command completed successfully; ack to dequeue", response.Message);

            Assert.AreEqual("Domains Suspended Notification", response.Body);

            Assert.AreEqual("EPP-ABC-12345", response.ClientTransactionId);
            Assert.AreEqual("203355", response.ServerTransactionId);

            var notification = new DomainsSuspendedNotification(File.ReadAllText("DomainsSuspendedNotification.xml"));

            Assert.AreEqual("Data Quality", notification.SuspendedReason);
            Assert.IsNotNull(notification.CancelDate);
            Assert.AreEqual(new DateTime(2009, 12, 12, 0, 0, 13), notification.CancelDate.Value);
            Assert.IsNotNull(notification.SuspendedDomains);
            Assert.AreEqual(2, notification.SuspendedDomains.Count);
            Assert.AreEqual("epp-example1.co.uk", notification.SuspendedDomains.First());
            Assert.AreEqual("epp-example2.co.uk", notification.SuspendedDomains.Last());
        }
        public void TestAbuseNotification()
        {
            byte[] input = File.ReadAllBytes("AbuseNotification.xml");
            var response = new PollResponse(input);

            Assert.AreEqual("1301", response.Code);
            Assert.AreEqual("Command completed successfully; ack to dequeue", response.Message);

            Assert.AreEqual("Domain Activity Notification", response.Body);

            Assert.AreEqual("EPP-12345C-8BF-4CAA-A944-2F0EFCD37D9E", response.ClientTransactionId);
            Assert.AreEqual("1254234", response.ServerTransactionId);

            var notification = new AbuseNotification(File.ReadAllText("AbuseNotification.xml"));

            Assert.AreEqual("phished.co.uk", notification.DomainName);
            Assert.AreEqual("phished.co.uk", notification.Key);
            Assert.AreEqual("phishing", notification.Activity);
            Assert.AreEqual("Netcraft", notification.Source);
            Assert.AreEqual("www.youve.been.phished.co.uk", notification.HostName);
            Assert.AreEqual("http://www.youve.been.phished.co.uk/give/us/your/money.htm", notification.Url);
            Assert.IsNotNull(notification.Date);
            Assert.AreEqual(new DateTime(2011, 3, 1, 11, 44, 1), notification.Date.Value);
            Assert.AreEqual("213.135.134.24", notification.Ip);
            Assert.AreEqual("ns0.crooked.dealings.net", notification.Nameserver);
            Assert.AreEqual("*****@*****.**", notification.DnsAdmin);
            Assert.AreEqual("paypal", notification.Target);
            Assert.IsNotNull(notification.WholeDomain);
            Assert.AreEqual(YesNoFlag.Y, notification.WholeDomain);
        }
        public void TestPollMsgsResponse2()
        {
            byte[] input = File.ReadAllBytes("DomainNameCancelledNotification.xml");
            var response = new PollResponse(input);

            Assert.AreEqual("1301", response.Code);
            Assert.AreEqual("Command completed successfully; ack to dequeue", response.Message);

            Assert.AreEqual("Domain Name Cancellation Notification", response.Body);

            Assert.AreEqual("ABC-12345", response.ClientTransactionId);
            Assert.AreEqual("54322-XYZ", response.ServerTransactionId);

            var notification = new DomainCancellationNotification(File.ReadAllText("DomainNameCancelledNotification.xml"));

            Assert.AreEqual("cancelleddomain.co.uk", notification.DomainName);
            Assert.AreEqual("*****@*****.**", notification.Originator);
        }
Example #4
0
        public void TestPollMsgsResponse2()
        {
            byte[] input = File.ReadAllBytes("PollMsgsResponse2.xml");
            var response = new PollResponse(input);

            Assert.AreEqual("1301", response.Code);
            Assert.AreEqual("Command completed successfully; ack to dequeue", response.Message);

            Assert.AreEqual("Domains Released Notification", response.Body);

            Assert.AreEqual("ABC-12345", response.ClientTransactionId);
            Assert.AreEqual("54322-XYZ", response.ServerTransactionId);

            var notification = new DomainsReleasedNotification(File.ReadAllText("PollMsgsResponse2.xml"));

            Assert.IsNotNull(notification.DomainsReleased);
        }
Example #5
0
        public void TestPollMsgsResponse1()
        {
            byte[] input = File.ReadAllBytes("PollMsgsResponse1.xml");
            var response = new PollResponse(input);

            Assert.AreEqual("1301", response.Code);
            Assert.AreEqual("Command completed successfully; ack to dequeue", response.Message);

            Assert.AreEqual("Contact deleted notification", response.Body);

            Assert.AreEqual("ABC-12345", response.ClientTransactionId);
            Assert.AreEqual("54322-XYZ", response.ServerTransactionId);
        }
Example #6
0
        public void TestPollNoMsgsResponse1()
        {
            byte[] input = File.ReadAllBytes("PollNoMsgsResponse1.xml");
            var response = new PollResponse(input);

            Assert.AreEqual("1300", response.Code);
            Assert.AreEqual("Command completed successfully; no messages", response.Message);

            Assert.AreEqual("ABC-12345", response.ClientTransactionId);
            Assert.AreEqual("54322-XYZ", response.ServerTransactionId);
        }