void testCreateSetVCardRequest_Error() { boost::shared_ptr<VCardManager> testling = createManager(); VCard::ref vcard = boost::make_shared<VCard>(); vcard->setFullName("New Name"); SetVCardRequest::ref request = testling->createSetVCardRequest(vcard); request->send(); stanzaChannel->onIQReceived(IQ::createError(JID("[email protected]/foo"), stanzaChannel->sentStanzas[0]->getID())); CPPUNIT_ASSERT_EQUAL(0, static_cast<int>(changes.size())); }
void testCreateSetVCardRequest() { boost::shared_ptr<VCardManager> testling = createManager(); VCard::ref vcard = boost::make_shared<VCard>(); vcard->setFullName("New Name"); SetVCardRequest::ref request = testling->createSetVCardRequest(vcard); request->send(); stanzaChannel->onIQReceived(createSetVCardResult()); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(changes.size())); CPPUNIT_ASSERT_EQUAL(ownJID.toBare(), changes[0].first); CPPUNIT_ASSERT_EQUAL(std::string("New Name"), changes[0].second->getFullName()); }