blob: 9ace6f5b8c35f2fe26ad12515009c38eda5a0d4a (
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
|
#include "Base64.h"
#include <string>
#include <cppunit/extensions/HelperMacros.h>
using namespace std;
class Base64Test:public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(Base64Test);
CPPUNIT_TEST(testEncode);
CPPUNIT_TEST(testDecode);
CPPUNIT_TEST_SUITE_END();
private:
public:
void setUp() {
}
void testEncode();
void testDecode();
};
CPPUNIT_TEST_SUITE_REGISTRATION( Base64Test );
void Base64Test::testEncode() {
CPPUNIT_ASSERT_EQUAL(string("SGVsbG8gV29ybGQh"),
Base64::encode("Hello World!"));
}
void Base64Test::testDecode() {
CPPUNIT_ASSERT_EQUAL(string("Hello World!"),
Base64::decode("SGVsbG8gV29ybGQh"));
}
|