Added JSON test case stubs for all class diagram test cases

This commit is contained in:
Bartek Kryza
2023-03-21 00:37:42 +01:00
parent b412f46fb2
commit c59fbfa565
64 changed files with 2189 additions and 1390 deletions

View File

@@ -22,6 +22,7 @@
namespace clanguml::class_diagram::model {
using nlohmann::json;
void to_json(nlohmann::json &j, const class_element &c)
{
j["name"] = c.name();
@@ -113,6 +114,11 @@ generator::generator(diagram_config &config, diagram_model &model)
void generator::generate(std::ostream &ostr) const
{
if (m_config.using_namespace)
json_["using_namespace"] = m_config.using_namespace().to_string();
json_["name"] = m_model.name();
json_["diagram_type"] = "class";
json_["elements"] = std::vector<nlohmann::json>{};
json_["relationships"] = std::vector<nlohmann::json>{};
@@ -120,9 +126,6 @@ void generator::generate(std::ostream &ostr) const
generate_relationships(json_);
json_["name"] = m_model.name();
json_["diagram_type"] = "class";
ostr << json_;
}

View File

@@ -84,6 +84,8 @@ public:
void generate_relationships(const package &p, nlohmann::json &parent) const;
private:
std::string render_name(std::string name) const;
mutable nlohmann::json json_;
};