#include "OTE/LPECheckResponse.hpp" #include "session/TestEnvironment.hpp" #include "xml/XMLParser.hpp" #include "xml/XMLDocument.hpp" #include "common/init.hpp" #include "common/Test.hpp" #include using namespace std; void doWork() { init("./etc/toolkit2.conf"); const string xml = "Command completed successfullyexample.comexample.netIn useexample.orgABC-1234554322-XYZ"; XMLParser parser; auto_ptr doc(parser.parse(xml)); LPECheckResponse response; response.fromXML(doc.get()); ASSERT_EQ(response.isAvailable("example.com"), true); ASSERT_EQ(response.getReason("example.net"), "In use"); ASSERT_EQ("In use", response.getReason(1)); ASSERT_EQ(3, response.getAvailableList().size()); ASSERT_EQ(3, response.getReasonList().size()); ASSERT_EQ(1000, response.getResults()[0].getResultCode()); ASSERT_EQ("ABC-12345", response.getCLTRID()); } int main(int argc, char* argv[]) { TEST_run(doWork); return TEST_errorCount(); }