package Ġcom . thought works . arch guard . code . module . domain . graph Ċ Ċ import Ġcom . thought works . arch guard . code . clazz . domain . J Field Ċ import Ġcom . thought works . arch guard . code . module . domain . model . Logic Component Ċ import Ġcom . thought works . arch guard . code . module . domain . model . Logic Module Ċ import Ġorg . assertj . core . api . Assertions . assertThat Ċ import Ġorg . junit . jupiter . api . BeforeEach Ċ import Ġorg . junit . jupiter . api . Test Ċ Ċ class ĠGraph Test Ġ{ ĊĠĠĠ Ġlateinit Ġvar Ġgraph Store : ĠGraph Store ĊĊĠĠĠ Ġ@ BeforeEach ĊĠĠĠ Ġinternal Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠĠĠ Ġgraph Store Ġ= ĠGraph Store () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġinternal Ġfun Ġshould _ add _ nodes _ and _ edges () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġlogic Module 1 Ġ= ĠLogic Module . create With Only Leaf Members (" id 1 ", Ġ" module 1 ", ĠlistOf ( Logic Component . create Leaf (" sub module 1 . class "))) ĊĠĠĠĠĠĠĠ Ġval Ġlogic Module 2 Ġ= ĠLogic Module . create With Only Leaf Members (" id 2 ", Ġ" module 2 ", ĠlistOf ( Logic Component . create Leaf (" sub module 2 . class "))) ĊĠĠĠĠĠĠĠ Ġval Ġlogic Module 3 Ġ= ĠLogic Module . create With Only Leaf Members (" id 3 ", Ġ" module 3 ", ĠlistOf ( Logic Component . create Leaf (" sub module 3 . class "))) ĊĊĠĠĠĠĠĠĠ Ġgraph Store . add Edge ( logic Module 1 , Ġlogic Module 2 , Ġ 3 ) ĊĠĠĠĠĠĠĠ Ġgraph Store . add Edge ( logic Module 1 , Ġlogic Module 3 , Ġ 2 ) ĊĠĠĠĠĠĠĠ Ġgraph Store . add Edge ( logic Module 2 , Ġlogic Module 3 , Ġ 2 ) ĊĠĠĠĠĠĠĠ Ġgraph Store . add Edge ( logic Module 1 , Ġlogic Module 2 , Ġ 2 ) ĊĊĠĠĠĠĠĠĠ Ġval Ġgraph Ġ= Ġgraph Store . get Graph () ĊĠĠĠĠĠĠĠ ĠassertThat ( graph . nodes . size ). isEqualTo ( 3 ) ĊĠĠĠĠĠĠĠ ĠassertThat ( graph . edges . size ). isEqualTo ( 3 ) ĊĠĠĠĠĠĠĠ ĠassertThat ( graph . edges ). contains ( Edge (" id 1 ", Ġ" id 2 ", Ġ 5 ), ĠEdge (" id 1 ", Ġ" id 3 ", Ġ 2 ), ĠEdge (" id 2 ", Ġ" id 3 ", Ġ 2 )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġinternal Ġfun Ġ` should Ġto Ġund irect ed Ġgraph `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġj Field 1 Ġ= ĠJ Field (" f 1 ", Ġ" f 1 ", Ġ" String ") ĊĠĠĠĠĠĠĠ Ġval Ġj Field 2 Ġ= ĠJ Field (" f 2 ", Ġ" f 2 ", Ġ" Int ") ĊĠĠĠĠĠĠĠ Ġval Ġj Field 3 Ġ= ĠJ Field (" f 3 ", Ġ" f 3 ", Ġ" Double ") ĊĠĠĠĠĠĠĠ Ġval Ġj Field 4 Ġ= ĠJ Field (" f 4 ", Ġ" f 4 ", Ġ" Double ") ĊĊĠĠĠĠĠĠĠ Ġval Ġgraph Ġ= ĠGraph Store () ĊĠĠĠĠĠĠĠ Ġgraph . add Edge ( j Field 1 , Ġj Field 2 ) ĊĠĠĠĠĠĠĠ Ġgraph . add Edge ( j Field 2 , Ġj Field 1 ) ĊĠĠĠĠĠĠĠ Ġgraph . add Edge ( j Field 3 , Ġj Field 4 ) ĊĠĠĠĠĠĠĠ ĠassertThat ( graph . get Graph (). edges . size ). isEqualTo ( 3 ) ĊĠĠĠĠĠĠĠ ĠassertThat ( graph . to Un directed Graph (). edges . size ). isEqualTo ( 4 ) ĊĠĠĠ Ġ} Ċ } Ċ