diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-10-17 12:13:36 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-10-21 18:25:00 (GMT) |
commit | 1b58ef2af54456004390a0888c3edf104e3baa99 (patch) | |
tree | dbe4ae29de1b765a88ea704dfaa1c03af4b196b3 /Swiften/Elements/UnitTest | |
parent | 07402c4e3451f2084a1c3ddc5bacfb38a66899a7 (diff) | |
download | swift-1b58ef2af54456004390a0888c3edf104e3baa99.zip swift-1b58ef2af54456004390a0888c3edf104e3baa99.tar.bz2 |
Added beginnings of outgoing file transfer to Swiften.
Diffstat (limited to 'Swiften/Elements/UnitTest')
-rw-r--r-- | Swiften/Elements/UnitTest/FormTest.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Swiften/Elements/UnitTest/FormTest.cpp b/Swiften/Elements/UnitTest/FormTest.cpp index 3852d98..715111b 100644 --- a/Swiften/Elements/UnitTest/FormTest.cpp +++ b/Swiften/Elements/UnitTest/FormTest.cpp @@ -15,6 +15,8 @@ using namespace Swift; class FormTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(FormTest); CPPUNIT_TEST(testGetFormType); + CPPUNIT_TEST(testGetFormType_InvalidFormType); + CPPUNIT_TEST(testGetFormType_NoFormType); CPPUNIT_TEST_SUITE_END(); public: @@ -31,6 +33,24 @@ class FormTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(String("jabber:bot"), form.getFormType()); } + + void testGetFormType_InvalidFormType() { + Form form; + + FormField::ref field = FixedFormField::create("jabber:bot"); + field->setName("FORM_TYPE"); + form.addField(field); + + CPPUNIT_ASSERT_EQUAL(String(""), form.getFormType()); + } + + void testGetFormType_NoFormType() { + Form form; + + form.addField(FixedFormField::create("Foo")); + + CPPUNIT_ASSERT_EQUAL(String(""), form.getFormType()); + } }; CPPUNIT_TEST_SUITE_REGISTRATION(FormTest); |