blob: 3852d98eab3137cb0b134519d36cb3ab2a2e8259 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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);
|