Added JSON test case stubs for all class diagram test cases
This commit is contained in:
@@ -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_;
|
||||
}
|
||||
|
||||
|
||||
@@ -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_;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user