#include "se/ContactCheckCommand.hpp" #include "se/AeDomainCreateCommand.hpp" #include "se/CLTRID.hpp" #include "session/Timer.hpp" #include "common/init.hpp" #include "common/Test.hpp" using namespace std; void doWork() { init("/home/drde/etc/toolkit2.conf"); const string registrantName = "AusRegistry"; const string registrantID = "01241326211"; const string registrantIDType = "Trade License"; const string eligibilityType = "Trade License (IT)"; const int policyReason = 1; const string eligibilityName = "Blah"; const string eligibilityID = "1231239523"; const string eligibilityIDType = "Trademark"; /** * Test that the XML string generated for a minimal create domain command * matches the expected XML for an EPP create domain command with those * parameters. */ { Timer::setTime("20070101.010101"); CLTRID::setClID("JTKUTEST"); vector techIds; techIds.push_back("JTKCON2"); string registrant("JTKCON"); AeDomainCreateCommand cmd("jtkutest.co.ae", "jtkUT3st", ®istrant, &techIds, eligibilityType, policyReason, registrantName); const string xml(cmd.toXML()); ASSERT_EQ(xml, "jtkutest.co.aeJTKCONJTKCON2jtkUT3stAusRegistryTrade License (IT)1JTKUTEST.20070101.010101.0"); } /** * Test that the XML string generated for a sample create domain command * specified with all available parameters matches the expected XML for * an EPP create domain command with those parameters. * */ { Timer::setTime("20070101.010101"); CLTRID::setClID("JTKUTEST"); vector techIds; techIds.push_back("JTKCON2"); vector adminContacts; adminContacts.push_back("JTKCON"); adminContacts.push_back("JTKCON2"); string registrant("JTKCON"); vector nameServers; nameServers.push_back("ns1.ausregistry.net"); nameServers.push_back("ns2.ausregistry.net"); Period period(48, PeriodUnit::MONTHS()); AeDomainCreateCommand cmd( "jtkutest.co.ae", "jtkUT3st", ®istrant, &techIds, &adminContacts, NULL, &nameServers, &period, eligibilityType, policyReason, registrantName, ®istrantID, ®istrantIDType, &eligibilityName, &eligibilityID, &eligibilityIDType); const string xml(cmd.toXML()); ASSERT_EQ(xml, "jtkutest.co.ae48ns1.ausregistry.netns2.ausregistry.netJTKCONJTKCONJTKCON2JTKCON2jtkUT3stAusRegistry01241326211Trade License (IT)Blah12312395231JTKUTEST.20070101.010101.0"); } } int main(int argc, char* argv[]) { TEST_run(doWork); return TEST_errorCount(); }