#include "se/AuDomainInfoResponse.hpp" #include "xml/XMLParser.hpp" #include "common/Test.hpp" #include "common/init.hpp" #include using namespace std; void doWork() { init("/home/drde/etc/toolkit2.conf"); const string xml = "Command completed successfullyexample.com.auD0000003-AREXAMPLEEXAMPLEns1.example.com.auns2.example.com.auns1.example.com.auns2.exmaple.com.auRegistrarRegistrar2006-02-09T15:44:58.0Z2008-02-10T00:00:00.0Z0192pqowRegistrantName Pty. Ltd.123456789OtherRegistrant Eligi9876543212ABC-12345805"; AuDomainInfoResponse response; try { auto_ptr parser(new XMLParser); auto_ptr doc(parser->parse(xml)); response.fromXML(doc.get()); ASSERT_EQ("123456789", response.getAURegistrantID()); ASSERT_EQ("RegistrantName Pty. Ltd.", response.getRegistrantName()); ASSERT_EQ("ACN", response.getRegistrantIDType()); ASSERT_EQ("Other", response.getEligibilityType()); ASSERT_EQ("Registrant Eligi", response.getEligibilityName()); ASSERT_EQ("987654321", response.getEligibilityID()); ASSERT_EQ("ABN", response.getEligibilityIDType()); ASSERT_EQ(2, response.getPolicyReason()); ASSERT_EQ("example.com.au", response.getName()); ASSERT_EQ("D0000003-AR", response.getROID()); ASSERT_EQ("ABC-12345", response.getCLTRID()); } catch (EPPException& e) { FAIL(e.getMessage()); } } int main(int argc, char* argv[]) { TEST_run(doWork); return TEST_errorCount(); }