#include "se/DomainRegistrantTransferResponse.hpp"
#include "xml/XMLParser.hpp"
#include "session/Timer.hpp"
#include "common/Test.hpp"
#include "common/init.hpp"
#include "se/EPPDateFormatter.hpp"
using namespace std;
void doWork()
{
init("./etc/toolkit2.conf");
const string xml =
"Command completed successfullyexample.com2009-04-03T22:00:00.0ZABC-1234554321-XYZ";
DomainRegistrantTransferResponse response;
XMLParser parser;
auto_ptr doc(parser.parse(xml));
response.fromXML(doc.get());
{
ASSERT_EQ(response.getName(), "example.com");
constXMLGC::XMLGregorianCalendar *exDate = response.getExpiryDate();
string res = EPPDateFormatter::toXSDateTime(*exDate);
ASSERT_EQ(res, "2009-04-03T22:00:00.0Z");
const vector& results(response.getResults());
ASSERT_EQ(response.getCLTRID(), "ABC-12345");
ASSERT_EQ(results[0].getResultCode(), 1000);
ASSERT_EQ(results[0].getResultMessage(),
"Command completed successfully");
}
}
int main(int argc, char* argv[])
{
TEST_run(doWork);
return TEST_errorCount();
}