Added JSON test case stubs for all class diagram test cases
This commit is contained in:
@@ -27,34 +27,43 @@ TEST_CASE("t00049", "[test-case][class]")
|
||||
auto model = generate_class_diagram(*db, diagram);
|
||||
|
||||
REQUIRE(model->name() == "t00049_class");
|
||||
{
|
||||
auto puml = generate_class_puml(diagram, *model);
|
||||
AliasMatcher _A(puml);
|
||||
|
||||
auto puml = generate_class_puml(diagram, *model);
|
||||
AliasMatcher _A(puml);
|
||||
REQUIRE_THAT(puml, StartsWith("@startuml"));
|
||||
REQUIRE_THAT(puml, EndsWith("@enduml\n"));
|
||||
|
||||
REQUIRE_THAT(puml, StartsWith("@startuml"));
|
||||
REQUIRE_THAT(puml, EndsWith("@enduml\n"));
|
||||
// Check if all classes exist
|
||||
REQUIRE_THAT(puml, IsClass(_A("R")));
|
||||
|
||||
// Check if all classes exist
|
||||
REQUIRE_THAT(puml, IsClass(_A("R")));
|
||||
// Check if class templates exist
|
||||
REQUIRE_THAT(puml, IsClassTemplate("A", "T"));
|
||||
|
||||
// Check if class templates exist
|
||||
REQUIRE_THAT(puml, IsClassTemplate("A", "T"));
|
||||
// Check if all methods exist
|
||||
REQUIRE_THAT(puml, (IsMethod<Public>("get_int_map", "A<intmap>")));
|
||||
REQUIRE_THAT(puml,
|
||||
(IsMethod<Public>("set_int_map", "void", "A<intmap> && int_map")));
|
||||
|
||||
// Check if all methods exist
|
||||
REQUIRE_THAT(puml, (IsMethod<Public>("get_int_map", "A<intmap>")));
|
||||
REQUIRE_THAT(puml,
|
||||
(IsMethod<Public>("set_int_map", "void", "A<intmap> && int_map")));
|
||||
// Check if all fields exist
|
||||
REQUIRE_THAT(puml, (IsField<Public>("a_string", "A<thestring>")));
|
||||
REQUIRE_THAT(
|
||||
puml, (IsField<Public>("a_vector_string", "A<string_vector>")));
|
||||
REQUIRE_THAT(puml, (IsField<Public>("a_int_map", "A<intmap>")));
|
||||
|
||||
// Check if all fields exist
|
||||
REQUIRE_THAT(puml, (IsField<Public>("a_string", "A<thestring>")));
|
||||
REQUIRE_THAT(
|
||||
puml, (IsField<Public>("a_vector_string", "A<string_vector>")));
|
||||
REQUIRE_THAT(puml, (IsField<Public>("a_int_map", "A<intmap>")));
|
||||
// Check if all relationships exist
|
||||
REQUIRE_THAT(puml, IsInstantiation(_A("A<T>"), _A("A<string_vector>")));
|
||||
REQUIRE_THAT(puml, IsInstantiation(_A("A<T>"), _A("A<thestring>")));
|
||||
REQUIRE_THAT(puml, IsInstantiation(_A("A<T>"), _A("A<intmap>")));
|
||||
|
||||
// Check if all relationships exist
|
||||
REQUIRE_THAT(puml, IsInstantiation(_A("A<T>"), _A("A<string_vector>")));
|
||||
REQUIRE_THAT(puml, IsInstantiation(_A("A<T>"), _A("A<thestring>")));
|
||||
REQUIRE_THAT(puml, IsInstantiation(_A("A<T>"), _A("A<intmap>")));
|
||||
save_puml(
|
||||
config.output_directory() + "/" + diagram->name + ".puml", puml);
|
||||
}
|
||||
{
|
||||
auto j = generate_class_json(diagram, *model);
|
||||
|
||||
save_puml(config.output_directory() + "/" + diagram->name + ".puml", puml);
|
||||
using namespace json;
|
||||
|
||||
save_json(config.output_directory() + "/" + diagram->name + ".json", j);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user