-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconceptmapratingcomplexity_test.cpp
More file actions
78 lines (68 loc) · 2.13 KB
/
conceptmapratingcomplexity_test.cpp
File metadata and controls
78 lines (68 loc) · 2.13 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#include "conceptmapratingcomplexity.h"
#include <iostream>
#include <sstream>
#include <boost/test/unit_test.hpp>
using namespace ribi::cmap;
BOOST_AUTO_TEST_CASE(ribi_cmap_rating_complexity_comparison)
{
const auto r = CreateDefaultRatingComplexity();
const auto s = CreateTestRatingComplexity();
BOOST_CHECK_EQUAL(r, r);
BOOST_CHECK_EQUAL(s, s);
BOOST_CHECK_NE(r, s);
BOOST_CHECK_NE(s, r);
}
BOOST_AUTO_TEST_CASE(ribi_cmap_rating_complexity_to_html)
{
const auto r = CreateDefaultRatingComplexity();
const auto html = ToHtml(r);
BOOST_CHECK(html.find("<table") != std::string::npos);
BOOST_CHECK(html.find("</table>") != std::string::npos);
}
BOOST_AUTO_TEST_CASE(ribi_cmap_rating_complexity_to_html_differs)
{
const auto r = CreateDefaultRatingComplexity();
const auto s = CreateTestRatingComplexity();
assert(r != s);
const auto html_1 = ToHtml(r);
const auto html_2 = ToHtml(s);
BOOST_CHECK_NE(r, s);
}
BOOST_AUTO_TEST_CASE(ribi_cmap_rating_complexity_to_html_examples_emph)
{
const auto r = CreateDefaultRatingComplexity();
// n_examples_emph
const auto html_1 = ToHtml(r, 1);
const auto html_2 = ToHtml(r, 2);
BOOST_CHECK_EQUAL(html_1, html_1);
BOOST_CHECK_NE(html_1, html_2);
}
BOOST_AUTO_TEST_CASE(ribi_cmap_rating_complexity_to_html_relations_emph)
{
const auto r = CreateDefaultRatingComplexity();
const auto html_1 = ToHtml(r, 1, 1);
const auto html_2 = ToHtml(r, 1, 2);
BOOST_CHECK_EQUAL(html_1, html_1);
BOOST_CHECK_NE(html_1, html_2);
}
BOOST_AUTO_TEST_CASE(ribi_cmap_rating_complexity_to_xml)
{
const auto r = CreateDefaultRatingComplexity();
const auto s = CreateTestRatingComplexity();
const auto xml_1 = ToXml(r);
const auto xml_2 = ToXml(s);
BOOST_CHECK_NE(xml_1, xml_2);
}
BOOST_AUTO_TEST_CASE(ribi_cmap_rating_complexity_to_xml_and_back)
{
const auto r = CreateDefaultRatingComplexity();
const auto xml = ToXml(r);
const auto s = XmlToRatingComplexity(xml);
BOOST_CHECK_EQUAL(r, s);
}
BOOST_AUTO_TEST_CASE(ribi_cmap_rating_complexity_to_stream)
{
std::stringstream s;
s << CreateDefaultRatingComplexity();
BOOST_CHECK(!s.str().empty());
}