public void TestHostCheckResponse1() { byte[] input = File.ReadAllBytes("HostCheckResponse1.xml"); var response = new HostCheckResponse(input); Assert.AreEqual("1000", response.Code); Assert.AreEqual("Command completed successfully", response.Message); List <HostCheckResult> expectedResults = new List <HostCheckResult>() { new HostCheckResult() { Name = "ns1.example.com", Available = true, Reason = null }, new HostCheckResult() { Name = "ns2.example2.com", Available = false, Reason = "In use" }, new HostCheckResult() { Name = "ns3.example3.com", Available = true, Reason = null } }; CollectionAssert.AreEqual(expectedResults.ToArray(), response.Results.ToArray()); Assert.AreEqual("ABC-12345", response.ClientTransactionId); Assert.AreEqual("54322-XYZ", response.ServerTransactionId); }
public void TestHostCheckResponse() { var eppResponse = new HostCheckResponse(ToBytes(@"<?xml version=""1.0"" encoding=""UTF-8"" standalone=""no""?> <epp xmlns=""urn:ietf:params:xml:ns:epp-1.0""> <response> <result code=""1000""> <msg>Command completed successfully</msg> </result> <resData> <host:chkData xmlns:host=""urn:ietf:params:xml:ns:host-1.0""> <host:cd> <host:name avail=""true"">ns1.example.ca</host:name> </host:cd> <host:cd> <host:name avail=""false"">ns2.example.ca</host:name> <host:reason>Selected host name is not available</host:reason> </host:cd> </host:chkData> </resData> <trID> <clTRID>ABC-12345</clTRID> <svTRID>cira-000001-0000001</svTRID> </trID> </response> </epp> ")); PrintResponse(eppResponse); }