summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-09-14 16:17:30 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-09-14 19:48:53 (GMT)
commitef5a4dc3a5b0224628a225ef0dccc679287478be (patch)
tree126d8f752f18d3d5891cd32cacf2a21734ab0b92 /Swiften/Elements/UnitTest
parent9ecba612d790c1f613dc959888f62e5d3575faae (diff)
downloadswift-contrib-ef5a4dc3a5b0224628a225ef0dccc679287478be.zip
swift-contrib-ef5a4dc3a5b0224628a225ef0dccc679287478be.tar.bz2
Add extended disco support to caps verifier.
Diffstat (limited to 'Swiften/Elements/UnitTest')
-rw-r--r--Swiften/Elements/UnitTest/FormTest.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/Swiften/Elements/UnitTest/FormTest.cpp b/Swiften/Elements/UnitTest/FormTest.cpp
new file mode 100644
index 0000000..3852d98
--- /dev/null
+++ b/Swiften/Elements/UnitTest/FormTest.cpp
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2010 Remko Tronçon
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <boost/shared_ptr.hpp>
+
+#include "Swiften/Elements/Form.h"
+
+using namespace Swift;
+
+class FormTest : public CppUnit::TestFixture {
+ CPPUNIT_TEST_SUITE(FormTest);
+ CPPUNIT_TEST(testGetFormType);
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+ void testGetFormType() {
+ Form form;
+
+ form.addField(FixedFormField::create("Foo"));
+
+ FormField::ref field = HiddenFormField::create("jabber:bot");
+ field->setName("FORM_TYPE");
+ form.addField(field);
+
+ form.addField(FixedFormField::create("Bar"));
+
+ CPPUNIT_ASSERT_EQUAL(String("jabber:bot"), form.getFormType());
+ }
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION(FormTest);