bdUnit Example MGraph Output


/ Published in: Other
Save to your folder(s)



Copy this code and paste it in your HTML
  1. [
  2. Test{
  3. Title{
  4. "\"A_Contrived_Example\""
  5. },
  6. TypeList[
  7. Type{
  8. ConcreteClass{
  9. Name => "Blog"
  10. },
  11. PropertyList[
  12. Property{
  13. Name => "Title"
  14. },
  15. Property{
  16. Name{
  17. "CreatedDate"
  18. },
  19. DefaultValue{
  20. Value => "\"01/08/2009\""
  21. }
  22. },
  23. Property{
  24. Name{
  25. "Entries"
  26. },
  27. DefaultValue{
  28. ConcreteClass{
  29. Name => "Post"
  30. }
  31. },
  32. Relation{
  33. "ManyToOne"
  34. }
  35. },
  36. Property{
  37. Name{
  38. "Author"
  39. },
  40. DefaultValue{
  41. ConcreteClass{
  42. Name => "User"
  43. }
  44. }
  45. },
  46. Property{
  47. Name{
  48. "Commenters"
  49. },
  50. DefaultValue{
  51. ConcreteClass{
  52. Name => "User"
  53. }
  54. },
  55. Relation{
  56. "ManyToOne"
  57. }
  58. }
  59. ],
  60. null
  61. },
  62. Type{
  63. ConcreteClass{
  64. Name => "Post"
  65. },
  66. PropertyList[
  67. Property{
  68. Name => "Title"
  69. },
  70. Property{
  71. Name => "Content"
  72. },
  73. Property{
  74. Name{
  75. "PublicationDate"
  76. },
  77. DefaultValue{
  78. Value => "\"01/08/2009\""
  79. }
  80. },
  81. Property{
  82. Name{
  83. "Comments"
  84. },
  85. DefaultValue{
  86. ConcreteClass{
  87. Name => "Comment"
  88. }
  89. },
  90. Relation{
  91. "ManyToOne"
  92. }
  93. },
  94. Property{
  95. Name => "Tags",
  96. Relation => "ManyToOne"
  97. }
  98. ],
  99. null
  100. },
  101. Type{
  102. ConcreteClass{
  103. Name => "User"
  104. },
  105. PropertyList[
  106. Property{
  107. Name => "Username"
  108. },
  109. Property{
  110. Name => "Password"
  111. },
  112. Property{
  113. Name => "EmailAddress"
  114. },
  115. Property{
  116. Name{
  117. "PostCount"
  118. },
  119. DefaultValue{
  120. Value => "0"
  121. }
  122. }
  123. ],
  124. StatementList[
  125. CreateMethod{
  126. TargetMethod{
  127. Name{
  128. "Publish"
  129. },
  130. ConcreteClasses[
  131. ConcreteClass{
  132. Name => "User"
  133. },
  134. ConcreteClass{
  135. Name => "Post"
  136. }
  137. ]
  138. }
  139. },
  140. CreateMethod{
  141. TargetMethod{
  142. Name{
  143. "UnPublish"
  144. },
  145. ConcreteClasses[
  146. ConcreteClass{
  147. Name => "User"
  148. },
  149. ConcreteClass{
  150. Name => "Post"
  151. }
  152. ],
  153. Relation{
  154. "ManyToOne"
  155. }
  156. }
  157. },
  158. CreateMethod{
  159. TargetMethod{
  160. Name{
  161. "CommentOn"
  162. },
  163. ConcreteClasses[
  164. ConcreteClass{
  165. Name => "User"
  166. },
  167. ConcreteClass{
  168. Name => "Post"
  169. }
  170. ]
  171. }
  172. }
  173. ]
  174. },
  175. Type{
  176. ConcreteClass{
  177. Name => "Comment"
  178. },
  179. PropertyList[
  180. Property{
  181. Name{
  182. "Author"
  183. },
  184. DefaultValue{
  185. ConcreteClass{
  186. Name => "User"
  187. }
  188. }
  189. },
  190. Property{
  191. Name => "Content"
  192. },
  193. Property{
  194. Name{
  195. "CreatedDate"
  196. },
  197. DefaultValue{
  198. Value => "\"01/08/2009\""
  199. }
  200. }
  201. ],
  202. null
  203. }
  204. ],
  205. StatementList[
  206. When{
  207. TargetList[
  208. Target{
  209. TargetProperty{
  210. Name{
  211. "Username"
  212. },
  213. ConcreteClasses[
  214. ConcreteClass{
  215. Name{
  216. "User"
  217. },
  218. Instance{
  219. Value => "Chris"
  220. }
  221. }
  222. ],
  223. Operators[
  224. Operator{
  225. Value => "=="
  226. }
  227. ],
  228. Value{
  229. "\"chriscanal\""
  230. }
  231. }
  232. },
  233. Target{
  234. TargetProperty{
  235. Name{
  236. "Title"
  237. },
  238. ConcreteClasses[
  239. ConcreteClass{
  240. Name{
  241. "Post"
  242. },
  243. Instance{
  244. Value => "DSLs"
  245. }
  246. }
  247. ],
  248. Operators[
  249. Operator{
  250. Value => "=="
  251. }
  252. ],
  253. Value{
  254. "\"An Evening of DSLs\""
  255. }
  256. }
  257. },
  258. Target{
  259. TargetProperty{
  260. Name{
  261. "Author"
  262. },
  263. ConcreteClasses[
  264. ConcreteClass{
  265. Name{
  266. "Blog"
  267. },
  268. Instance{
  269. Value => "ScotAltNet"
  270. }
  271. }
  272. ],
  273. Operators[
  274. Operator{
  275. Value => "=="
  276. }
  277. ],
  278. Value{
  279. "Chris"
  280. }
  281. }
  282. },
  283. Target{
  284. TargetMethod{
  285. Name{
  286. "Publish"
  287. },
  288. ConcreteClasses[
  289. ConcreteClass{
  290. Name{
  291. "User"
  292. },
  293. Instance{
  294. Value => "Chris"
  295. }
  296. },
  297. ConcreteClass{
  298. Name{
  299. "Post"
  300. },
  301. Instance{
  302. Value => "DSLs"
  303. }
  304. }
  305. ]
  306. }
  307. }
  308. ],
  309. Constraints[
  310. Constraint{
  311. Property{
  312. Name{
  313. "Entries"
  314. },
  315. ConcreteClass{
  316. Name{
  317. "Blog"
  318. },
  319. Instance{
  320. Value => "ScotAltNet"
  321. }
  322. },
  323. Count{
  324. Value{
  325. "0"
  326. },
  327. Operators[
  328. Operator{
  329. Value => ">"
  330. }
  331. ]
  332. }
  333. }
  334. },
  335. Constraint{
  336. ConcreteClassPropertyMapping{
  337. ConcreteClasses[
  338. ConcreteClass{
  339. Name{
  340. "Blog"
  341. },
  342. Instance{
  343. Value => "ScotAltNet"
  344. }
  345. },
  346. ConcreteClass{
  347. Name{
  348. "Post"
  349. },
  350. Instance{
  351. Value => "DSLs"
  352. }
  353. }
  354. ],
  355. Properties[
  356. Property{
  357. Name => "Entries"
  358. },
  359. Property{
  360. Name => "Title",
  361. Relation => "LinqSubset"
  362. }
  363. ]
  364. },
  365. Operators[
  366. Operator{
  367. Value => "contains"
  368. }
  369. ]
  370. },
  371. Constraint{
  372. ConcreteClassPropertyMapping{
  373. ConcreteClasses[
  374. ConcreteClass{
  375. Name{
  376. "Post"
  377. },
  378. Instance{
  379. Value => "DSLs"
  380. }
  381. },
  382. ConcreteClass{
  383. Name{
  384. "Blog"
  385. },
  386. Instance{
  387. Value => "ScotAltNet"
  388. }
  389. }
  390. ],
  391. Properties[
  392. Property{
  393. Name => "PublicationDate"
  394. },
  395. Property{
  396. Name => "CreatedDate"
  397. }
  398. ]
  399. },
  400. Operators[
  401. Operator{
  402. Value => ">"
  403. }
  404. ]
  405. },
  406. Constraint{
  407. Property{
  408. Name{
  409. "PostCount"
  410. },
  411. ConcreteClass{
  412. Name{
  413. "User"
  414. },
  415. Instance{
  416. Value => "Chris"
  417. }
  418. },
  419. Operators[
  420. Operator{
  421. Value => "=="
  422. }
  423. ],
  424. Value{
  425. "1"
  426. }
  427. }
  428. }
  429. ]
  430. }
  431. ]
  432. }
  433. ]

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.