Added sequence diagram JSON test matchers
This commit is contained in:
@@ -28,22 +28,28 @@ TEST_CASE("t20005", "[test-case][sequence]")
|
||||
|
||||
REQUIRE(model->name() == "t20005_sequence");
|
||||
|
||||
auto puml = generate_sequence_puml(diagram, *model);
|
||||
AliasMatcher _A(puml);
|
||||
{
|
||||
auto puml = generate_sequence_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 calls exist
|
||||
REQUIRE_THAT(puml, HasEntrypoint(_A("C<T>"), "c(T)"));
|
||||
REQUIRE_THAT(puml, HasCall(_A("C<T>"), _A("B<T>"), "b(T)"));
|
||||
REQUIRE_THAT(puml, HasCall(_A("B<T>"), _A("A<T>"), "a(T)"));
|
||||
REQUIRE_THAT(puml, HasExitpoint(_A("C<T>")));
|
||||
save_puml(config.output_directory() + "/" + diagram->name + ".puml", puml);
|
||||
// Check if all calls exist
|
||||
REQUIRE_THAT(puml, HasEntrypoint(_A("C<T>"), "c(T)"));
|
||||
REQUIRE_THAT(puml, HasCall(_A("C<T>"), _A("B<T>"), "b(T)"));
|
||||
REQUIRE_THAT(puml, HasCall(_A("B<T>"), _A("A<T>"), "a(T)"));
|
||||
REQUIRE_THAT(puml, HasExitpoint(_A("C<T>")));
|
||||
|
||||
auto j = generate_sequence_json(diagram, *model);
|
||||
save_puml(
|
||||
config.output_directory() + "/" + diagram->name + ".puml", puml);
|
||||
}
|
||||
|
||||
// REQUIRE(j == nlohmann::json::parse(expected_json));
|
||||
{
|
||||
auto j = generate_sequence_json(diagram, *model);
|
||||
|
||||
save_json(config.output_directory() + "/" + diagram->name + ".json", j);
|
||||
using namespace json;
|
||||
|
||||
save_json(config.output_directory() + "/" + diagram->name + ".json", j);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user