#include "se/AuDomainTransferRegistrantCommand.hpp" #include "se/CLTRID.hpp" #include "se/EPPDateFormatter.hpp" #include "se/Period.hpp" #include "session/Timer.hpp" #include "common/init.hpp" #include "common/Test.hpp" #include using namespace std; void doWork() { init("./etc/toolkit2.conf"); const int policyReason = 1; const string registrantName = "AusRegistry"; const string registrantID = "01241326211"; const string registrantIDType = "ACN"; const string eligibilityType = "Company"; const string eligibilityName = "Blah"; const string eligibilityID = "1231239523"; const string eligibilityIDType = "OTHER"; auto_ptr curExpDate(EPPDateFormatter::fromXSDateTime("2014-01-01T01:01:01.0Z")); { Timer::setTime("20070101.010101"); CLTRID::setClID("JTKUTEST"); AuDomainTransferRegistrantCommand cmd( "jtkutest.com.au", // domain name *curExpDate, // current expire date "Other", policyReason, registrantName, "testing"); const string xml(cmd.toXML()); ASSERT_EQ(xml, "jtkutest.com.au2014-01-01AusRegistryOther1testingJTKUTEST.20070101.010101.0"); } { Timer::setTime("20070101.010101"); CLTRID::setClID("JTKUTEST"); Period p(2, PeriodUnit::YEARS()); AuDomainTransferRegistrantCommand cmd( "jtkutest.com.au", // name *curExpDate, // curExpDate eligibilityType, policyReason, registrantName, "testing", ®istrantID, ®istrantIDType, &eligibilityName, &eligibilityID, &eligibilityIDType, &p); const string xml(cmd.toXML()); ASSERT_EQ(xml, "jtkutest.com.au2014-01-012AusRegistry01241326211CompanyBlah12312395231testingJTKUTEST.20070101.010101.0"); } } int main(int argc, char* argv[]) { TEST_run(doWork); return TEST_errorCount(); }