/* **************************************************************************** * * all - */ TEST(ContextRegistrationResponseVector, all) { ContextRegistrationResponse crr; ContextRegistrationResponseVector crrV; std::string rendered; crr.contextRegistration.providingApplication.set("10.1.1.1://nada"); // Empty vector gives empty rendered result rendered = crrV.render(XML, ""); EXPECT_EQ("", rendered); crrV.push_back(&crr); // presenting - just to exercise the code crrV.present(""); // check OK rendered = crrV.check(RegisterContext, XML, "", "", 0); EXPECT_EQ("OK", rendered); // Now telling the crr that we've found an instance of '<entityIdList></entityIdList> // but without any entities inside the vector crr.contextRegistration.entityIdVectorPresent = true; rendered = crrV.check(RegisterContext, XML, "", "", 0); EXPECT_EQ("Empty entityIdVector", rendered); EntityId eId; // Empty ID crr.contextRegistration.entityIdVector.push_back(&eId); rendered = crrV.check(RegisterContext, XML, "", "", 0); EXPECT_EQ("empty entityId:id", rendered); }