@alloy-js/csharp 0.20.0-dev.0 → 0.20.0-dev.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (399) hide show
  1. package/dist/src/components/Declaration.d.ts +2 -2
  2. package/dist/src/components/Declaration.d.ts.map +1 -1
  3. package/dist/src/components/Declaration.js +5 -14
  4. package/dist/src/components/Declaration.js.map +1 -0
  5. package/dist/src/components/Name.js +2 -1
  6. package/dist/src/components/Name.js.map +1 -0
  7. package/dist/src/components/ProjectDirectory.js +2 -1
  8. package/dist/src/components/ProjectDirectory.js.map +1 -0
  9. package/dist/src/components/Reference.d.ts.map +1 -1
  10. package/dist/src/components/Reference.js +7 -2
  11. package/dist/src/components/Reference.js.map +1 -0
  12. package/dist/src/components/UsingDirective.d.ts +5 -1
  13. package/dist/src/components/UsingDirective.d.ts.map +1 -1
  14. package/dist/src/components/UsingDirective.js +5 -2
  15. package/dist/src/components/UsingDirective.js.map +1 -0
  16. package/dist/src/components/access-expression/access-expression.d.ts +54 -0
  17. package/dist/src/components/access-expression/access-expression.d.ts.map +1 -0
  18. package/dist/src/components/access-expression/access-expression.js +277 -0
  19. package/dist/src/components/access-expression/access-expression.js.map +1 -0
  20. package/dist/src/components/access-expression/access-expression.test.d.ts +2 -0
  21. package/dist/src/components/access-expression/access-expression.test.d.ts.map +1 -0
  22. package/dist/src/components/access-expression/access-expression.test.js +336 -0
  23. package/dist/src/components/access-expression/access-expression.test.js.map +1 -0
  24. package/dist/src/components/access-expression/part-descriptors.d.ts +32 -0
  25. package/dist/src/components/access-expression/part-descriptors.d.ts.map +1 -0
  26. package/dist/src/components/access-expression/part-descriptors.js +99 -0
  27. package/dist/src/components/access-expression/part-descriptors.js.map +1 -0
  28. package/dist/src/components/attributes/attributes.js +2 -1
  29. package/dist/src/components/attributes/attributes.js.map +1 -0
  30. package/dist/src/components/attributes/attributes.test.js +2 -1
  31. package/dist/src/components/attributes/attributes.test.js.map +1 -0
  32. package/dist/src/components/{ClassDeclaration.d.ts → class/declaration.d.ts} +30 -12
  33. package/dist/src/components/class/declaration.d.ts.map +1 -0
  34. package/dist/src/components/class/declaration.js +87 -0
  35. package/dist/src/components/class/declaration.js.map +1 -0
  36. package/dist/src/components/class/declaration.test.d.ts +2 -0
  37. package/dist/src/components/class/declaration.test.d.ts.map +1 -0
  38. package/dist/src/components/class/declaration.test.js +573 -0
  39. package/dist/src/components/class/declaration.test.js.map +1 -0
  40. package/dist/src/components/constructor/constructor.d.ts.map +1 -1
  41. package/dist/src/components/constructor/constructor.js +13 -20
  42. package/dist/src/components/constructor/constructor.js.map +1 -0
  43. package/dist/src/components/constructor/constructor.test.js +13 -21
  44. package/dist/src/components/constructor/constructor.test.js.map +1 -0
  45. package/dist/src/components/doc/comment.js +2 -1
  46. package/dist/src/components/doc/comment.js.map +1 -0
  47. package/dist/src/components/doc/comment.test.js +2 -1
  48. package/dist/src/components/doc/comment.test.js.map +1 -0
  49. package/dist/src/components/doc/from-markdown.js +2 -1
  50. package/dist/src/components/doc/from-markdown.js.map +1 -0
  51. package/dist/src/components/doc/from-markdown.test.js +2 -1
  52. package/dist/src/components/doc/from-markdown.test.js.map +1 -0
  53. package/dist/src/components/{EnumDeclaration.d.ts → enum/declaration.d.ts} +6 -11
  54. package/dist/src/components/enum/declaration.d.ts.map +1 -0
  55. package/dist/src/components/enum/declaration.js +55 -0
  56. package/dist/src/components/enum/declaration.js.map +1 -0
  57. package/dist/src/components/enum/declaration.ref.test.d.ts +2 -0
  58. package/dist/src/components/enum/declaration.ref.test.d.ts.map +1 -0
  59. package/dist/src/components/enum/declaration.ref.test.js +121 -0
  60. package/dist/src/components/enum/declaration.ref.test.js.map +1 -0
  61. package/dist/src/components/enum/declaration.test.d.ts +2 -0
  62. package/dist/src/components/enum/declaration.test.d.ts.map +1 -0
  63. package/dist/src/components/enum/declaration.test.js +40 -0
  64. package/dist/src/components/enum/declaration.test.js.map +1 -0
  65. package/dist/src/components/enum/member.d.ts +7 -0
  66. package/dist/src/components/enum/member.d.ts.map +1 -0
  67. package/dist/src/components/enum/member.js +30 -0
  68. package/dist/src/components/enum/member.js.map +1 -0
  69. package/dist/src/components/enum/member.test.d.ts +2 -0
  70. package/dist/src/components/enum/member.test.d.ts.map +1 -0
  71. package/dist/src/components/enum/member.test.js +29 -0
  72. package/dist/src/components/enum/member.test.js.map +1 -0
  73. package/dist/src/components/field/field.d.ts.map +1 -1
  74. package/dist/src/components/field/field.js +11 -18
  75. package/dist/src/components/field/field.js.map +1 -0
  76. package/dist/src/components/field/field.test.js +10 -9
  77. package/dist/src/components/field/field.test.js.map +1 -0
  78. package/dist/src/components/index.d.ts +8 -4
  79. package/dist/src/components/index.d.ts.map +1 -1
  80. package/dist/src/components/index.js +10 -5
  81. package/dist/src/components/index.js.map +1 -0
  82. package/dist/src/components/interface/declaration.d.ts.map +1 -1
  83. package/dist/src/components/interface/declaration.js +21 -22
  84. package/dist/src/components/interface/declaration.js.map +1 -0
  85. package/dist/src/components/interface/declaration.test.js +28 -36
  86. package/dist/src/components/interface/declaration.test.js.map +1 -0
  87. package/dist/src/components/interface/method.d.ts.map +1 -1
  88. package/dist/src/components/interface/method.js +9 -19
  89. package/dist/src/components/interface/method.js.map +1 -0
  90. package/dist/src/components/interface/method.test.js +40 -48
  91. package/dist/src/components/interface/method.test.js.map +1 -0
  92. package/dist/src/components/interface/property.d.ts.map +1 -1
  93. package/dist/src/components/interface/property.js +23 -40
  94. package/dist/src/components/interface/property.js.map +1 -0
  95. package/dist/src/components/interface/property.test.js +13 -12
  96. package/dist/src/components/interface/property.test.js.map +1 -0
  97. package/dist/src/components/invocation-expression/invocation-expression.d.ts +29 -0
  98. package/dist/src/components/invocation-expression/invocation-expression.d.ts.map +1 -0
  99. package/dist/src/components/invocation-expression/invocation-expression.js +70 -0
  100. package/dist/src/components/invocation-expression/invocation-expression.js.map +1 -0
  101. package/dist/src/components/invocation-expression/invocation-expression.test.d.ts +2 -0
  102. package/dist/src/components/invocation-expression/invocation-expression.test.d.ts.map +1 -0
  103. package/dist/src/components/invocation-expression/invocation-expression.test.js +105 -0
  104. package/dist/src/components/invocation-expression/invocation-expression.test.js.map +1 -0
  105. package/dist/src/components/lexical-scope.d.ts +8 -0
  106. package/dist/src/components/lexical-scope.d.ts.map +1 -0
  107. package/dist/src/components/lexical-scope.js +25 -0
  108. package/dist/src/components/lexical-scope.js.map +1 -0
  109. package/dist/src/components/method/method.d.ts +5 -2
  110. package/dist/src/components/method/method.d.ts.map +1 -1
  111. package/dist/src/components/method/method.js +9 -17
  112. package/dist/src/components/method/method.js.map +1 -0
  113. package/dist/src/components/method/method.test.js +13 -12
  114. package/dist/src/components/method/method.test.js.map +1 -0
  115. package/dist/src/components/method-scope.d.ts +8 -0
  116. package/dist/src/components/method-scope.d.ts.map +1 -0
  117. package/dist/src/components/method-scope.js +25 -0
  118. package/dist/src/components/method-scope.js.map +1 -0
  119. package/dist/src/components/namespace-scopes.d.ts +13 -0
  120. package/dist/src/components/namespace-scopes.d.ts.map +1 -0
  121. package/dist/src/components/namespace-scopes.js +45 -0
  122. package/dist/src/components/namespace-scopes.js.map +1 -0
  123. package/dist/src/components/namespace.d.ts +7 -0
  124. package/dist/src/components/namespace.d.ts.map +1 -0
  125. package/dist/src/components/namespace.js +47 -0
  126. package/dist/src/components/namespace.js.map +1 -0
  127. package/dist/src/components/namespace.ref.test.d.ts +2 -0
  128. package/dist/src/components/namespace.ref.test.d.ts.map +1 -0
  129. package/dist/src/components/namespace.ref.test.js +182 -0
  130. package/dist/src/components/namespace.ref.test.js.map +1 -0
  131. package/dist/src/components/namespace.test.d.ts.map +1 -0
  132. package/dist/src/components/namespace.test.js +79 -0
  133. package/dist/src/components/namespace.test.js.map +1 -0
  134. package/dist/src/components/parameters/parameters.d.ts +2 -3
  135. package/dist/src/components/parameters/parameters.d.ts.map +1 -1
  136. package/dist/src/components/parameters/parameters.js +15 -15
  137. package/dist/src/components/parameters/parameters.js.map +1 -0
  138. package/dist/src/components/parameters/parameters.test.d.ts +2 -0
  139. package/dist/src/components/parameters/parameters.test.d.ts.map +1 -0
  140. package/dist/src/components/parameters/parameters.test.js +154 -0
  141. package/dist/src/components/parameters/parameters.test.js.map +1 -0
  142. package/dist/src/components/property/property.d.ts +2 -2
  143. package/dist/src/components/property/property.d.ts.map +1 -1
  144. package/dist/src/components/property/property.js +30 -40
  145. package/dist/src/components/property/property.js.map +1 -0
  146. package/dist/src/components/property/property.test.js +17 -16
  147. package/dist/src/components/property/property.test.js.map +1 -0
  148. package/dist/src/components/record/declaration.d.ts +18 -0
  149. package/dist/src/components/record/declaration.d.ts.map +1 -1
  150. package/dist/src/components/record/declaration.js +21 -14
  151. package/dist/src/components/record/declaration.js.map +1 -0
  152. package/dist/src/components/record/declaration.test.js +52 -4
  153. package/dist/src/components/record/declaration.test.js.map +1 -0
  154. package/dist/src/components/source-file/source-file.d.ts +19 -0
  155. package/dist/src/components/source-file/source-file.d.ts.map +1 -0
  156. package/dist/src/components/source-file/source-file.js +59 -0
  157. package/dist/src/components/source-file/source-file.js.map +1 -0
  158. package/dist/src/components/source-file/source-file.test.d.ts +2 -0
  159. package/dist/src/components/source-file/source-file.test.d.ts.map +1 -0
  160. package/dist/src/components/source-file/source-file.test.js +136 -0
  161. package/dist/src/components/source-file/source-file.test.js.map +1 -0
  162. package/dist/src/components/stc/index.js +2 -1
  163. package/dist/src/components/stc/index.js.map +1 -0
  164. package/dist/src/components/struct/declaration.d.ts.map +1 -1
  165. package/dist/src/components/struct/declaration.js +6 -7
  166. package/dist/src/components/struct/declaration.js.map +1 -0
  167. package/dist/src/components/struct/declaration.test.js +32 -40
  168. package/dist/src/components/struct/declaration.test.js.map +1 -0
  169. package/dist/src/components/type-parameters/type-parameter-constraints.js +2 -1
  170. package/dist/src/components/type-parameters/type-parameter-constraints.js.map +1 -0
  171. package/dist/src/components/type-parameters/type-parameter-constraints.test.js +2 -1
  172. package/dist/src/components/type-parameters/type-parameter-constraints.test.js.map +1 -0
  173. package/dist/src/components/type-parameters/type-parameter.d.ts.map +1 -1
  174. package/dist/src/components/type-parameters/type-parameter.js +9 -11
  175. package/dist/src/components/type-parameters/type-parameter.js.map +1 -0
  176. package/dist/src/components/type-parameters/type-parameters.js +2 -1
  177. package/dist/src/components/type-parameters/type-parameters.js.map +1 -0
  178. package/dist/src/components/type-parameters/type-parameters.test.js +5 -4
  179. package/dist/src/components/type-parameters/type-parameters.test.js.map +1 -0
  180. package/dist/src/components/var/declaration.d.ts.map +1 -1
  181. package/dist/src/components/var/declaration.js +8 -9
  182. package/dist/src/components/var/declaration.js.map +1 -0
  183. package/dist/src/components/var/declaration.test.js +13 -21
  184. package/dist/src/components/var/declaration.test.js.map +1 -0
  185. package/dist/src/contexts/format-options.d.ts +5 -0
  186. package/dist/src/contexts/format-options.d.ts.map +1 -0
  187. package/dist/src/contexts/format-options.js +9 -0
  188. package/dist/src/contexts/format-options.js.map +1 -0
  189. package/dist/src/contexts/global-namespace.d.ts +5 -0
  190. package/dist/src/contexts/global-namespace.d.ts.map +1 -0
  191. package/dist/src/contexts/global-namespace.js +25 -0
  192. package/dist/src/contexts/global-namespace.js.map +1 -0
  193. package/dist/src/contexts/namespace.d.ts +8 -0
  194. package/dist/src/contexts/namespace.d.ts.map +1 -0
  195. package/dist/src/contexts/namespace.js +6 -0
  196. package/dist/src/contexts/namespace.js.map +1 -0
  197. package/dist/src/index.d.ts +2 -0
  198. package/dist/src/index.d.ts.map +1 -1
  199. package/dist/src/index.js +4 -1
  200. package/dist/src/index.js.map +1 -0
  201. package/dist/src/modifiers.d.ts +11 -0
  202. package/dist/src/modifiers.d.ts.map +1 -1
  203. package/dist/src/modifiers.js +2 -1
  204. package/dist/src/modifiers.js.map +1 -0
  205. package/dist/src/name-policy.js +2 -1
  206. package/dist/src/name-policy.js.map +1 -0
  207. package/dist/src/scopes/class.d.ts +10 -0
  208. package/dist/src/scopes/class.d.ts.map +1 -0
  209. package/dist/src/scopes/class.js +11 -0
  210. package/dist/src/scopes/class.js.map +1 -0
  211. package/dist/src/scopes/contexts.d.ts +9 -0
  212. package/dist/src/scopes/contexts.d.ts.map +1 -0
  213. package/dist/src/scopes/contexts.js +34 -0
  214. package/dist/src/scopes/contexts.js.map +1 -0
  215. package/dist/src/scopes/csharp.d.ts +10 -0
  216. package/dist/src/scopes/csharp.d.ts.map +1 -0
  217. package/dist/src/scopes/csharp.js +15 -0
  218. package/dist/src/scopes/csharp.js.map +1 -0
  219. package/dist/src/scopes/factories.d.ts +9 -0
  220. package/dist/src/scopes/factories.d.ts.map +1 -0
  221. package/dist/src/scopes/factories.js +24 -0
  222. package/dist/src/scopes/factories.js.map +1 -0
  223. package/dist/src/scopes/index.d.ts +10 -0
  224. package/dist/src/scopes/index.d.ts.map +1 -0
  225. package/dist/src/scopes/index.js +10 -0
  226. package/dist/src/scopes/index.js.map +1 -0
  227. package/dist/src/scopes/lexical.d.ts +7 -0
  228. package/dist/src/scopes/lexical.d.ts.map +1 -0
  229. package/dist/src/scopes/lexical.js +8 -0
  230. package/dist/src/scopes/lexical.js.map +1 -0
  231. package/dist/src/scopes/method.d.ts +9 -0
  232. package/dist/src/scopes/method.d.ts.map +1 -0
  233. package/dist/src/scopes/method.js +14 -0
  234. package/dist/src/scopes/method.js.map +1 -0
  235. package/dist/src/scopes/named-type.d.ts +22 -0
  236. package/dist/src/scopes/named-type.d.ts.map +1 -0
  237. package/dist/src/scopes/named-type.js +33 -0
  238. package/dist/src/scopes/named-type.js.map +1 -0
  239. package/dist/src/scopes/namespace.d.ts +11 -0
  240. package/dist/src/scopes/namespace.d.ts.map +1 -0
  241. package/dist/src/scopes/namespace.js +39 -0
  242. package/dist/src/scopes/namespace.js.map +1 -0
  243. package/dist/src/scopes/source-file.d.ts +16 -0
  244. package/dist/src/scopes/source-file.d.ts.map +1 -0
  245. package/dist/src/scopes/source-file.js +44 -0
  246. package/dist/src/scopes/source-file.js.map +1 -0
  247. package/dist/src/symbols/csharp.d.ts +87 -0
  248. package/dist/src/symbols/csharp.d.ts.map +1 -0
  249. package/dist/src/symbols/csharp.js +246 -0
  250. package/dist/src/symbols/csharp.js.map +1 -0
  251. package/dist/src/symbols/factories.d.ts +25 -0
  252. package/dist/src/symbols/factories.d.ts.map +1 -0
  253. package/dist/src/symbols/factories.js +93 -0
  254. package/dist/src/symbols/factories.js.map +1 -0
  255. package/dist/src/symbols/index.d.ts +5 -2
  256. package/dist/src/symbols/index.d.ts.map +1 -1
  257. package/dist/src/symbols/index.js +6 -2
  258. package/dist/src/symbols/index.js.map +1 -0
  259. package/dist/src/symbols/method.d.ts +13 -0
  260. package/dist/src/symbols/method.d.ts.map +1 -0
  261. package/dist/src/symbols/method.js +16 -0
  262. package/dist/src/symbols/method.js.map +1 -0
  263. package/dist/src/symbols/named-type.d.ts +19 -0
  264. package/dist/src/symbols/named-type.d.ts.map +1 -0
  265. package/dist/src/symbols/named-type.js +31 -0
  266. package/dist/src/symbols/named-type.js.map +1 -0
  267. package/dist/src/symbols/namespace.d.ts +22 -0
  268. package/dist/src/symbols/namespace.d.ts.map +1 -0
  269. package/dist/src/symbols/namespace.js +45 -0
  270. package/dist/src/symbols/namespace.js.map +1 -0
  271. package/dist/src/symbols/reference.d.ts +2 -2
  272. package/dist/src/symbols/reference.d.ts.map +1 -1
  273. package/dist/src/symbols/reference.js +50 -44
  274. package/dist/src/symbols/reference.js.map +1 -0
  275. package/dist/test/project-directory.test.js +20 -19
  276. package/dist/test/project-directory.test.js.map +1 -0
  277. package/dist/test/using.test.js +23 -21
  278. package/dist/test/using.test.js.map +1 -0
  279. package/dist/test/utils.d.ts.map +1 -1
  280. package/dist/test/utils.js +7 -4
  281. package/dist/test/utils.js.map +1 -0
  282. package/dist/test/vitest.setup.js +2 -1
  283. package/dist/test/vitest.setup.js.map +1 -0
  284. package/dist/tsconfig.tsbuildinfo +1 -1
  285. package/package.json +12 -6
  286. package/src/components/Declaration.tsx +3 -6
  287. package/src/components/Reference.tsx +3 -1
  288. package/src/components/UsingDirective.tsx +12 -2
  289. package/src/components/access-expression/access-expression.test.tsx +284 -0
  290. package/src/components/access-expression/access-expression.tsx +375 -0
  291. package/src/components/access-expression/part-descriptors.ts +175 -0
  292. package/src/components/class/declaration.test.tsx +484 -0
  293. package/src/components/{ClassDeclaration.tsx → class/declaration.tsx} +63 -44
  294. package/src/components/constructor/constructor.test.tsx +11 -17
  295. package/src/components/constructor/constructor.tsx +13 -32
  296. package/src/components/enum/declaration.ref.test.tsx +93 -0
  297. package/src/components/enum/declaration.test.tsx +34 -0
  298. package/src/components/enum/declaration.tsx +65 -0
  299. package/src/components/enum/member.test.tsx +24 -0
  300. package/src/components/enum/member.tsx +36 -0
  301. package/src/components/field/field.test.tsx +8 -8
  302. package/src/components/field/field.tsx +12 -22
  303. package/src/components/index.ts +8 -4
  304. package/src/components/interface/declaration.test.tsx +26 -32
  305. package/src/components/interface/declaration.tsx +16 -18
  306. package/src/components/interface/method.test.tsx +38 -44
  307. package/src/components/interface/method.tsx +7 -20
  308. package/src/components/interface/property.test.tsx +11 -11
  309. package/src/components/interface/property.tsx +15 -34
  310. package/src/components/invocation-expression/invocation-expression.test.tsx +101 -0
  311. package/src/components/invocation-expression/invocation-expression.tsx +60 -0
  312. package/src/components/lexical-scope.tsx +29 -0
  313. package/src/components/method/method.test.tsx +11 -11
  314. package/src/components/method/method.tsx +12 -23
  315. package/src/components/method-scope.tsx +27 -0
  316. package/src/components/namespace-scopes.tsx +44 -0
  317. package/src/components/namespace.ref.test.tsx +139 -0
  318. package/src/components/namespace.test.tsx +52 -0
  319. package/src/components/namespace.tsx +45 -0
  320. package/src/components/parameters/parameters.test.tsx +117 -0
  321. package/src/components/parameters/parameters.tsx +11 -21
  322. package/src/components/property/property.test.tsx +15 -15
  323. package/src/components/property/property.tsx +23 -41
  324. package/src/components/record/declaration.test.tsx +47 -3
  325. package/src/components/record/declaration.tsx +34 -11
  326. package/src/components/source-file/source-file.test.tsx +96 -0
  327. package/src/components/source-file/source-file.tsx +98 -0
  328. package/src/components/struct/declaration.test.tsx +16 -22
  329. package/src/components/struct/declaration.tsx +4 -6
  330. package/src/components/type-parameters/type-parameter.tsx +14 -11
  331. package/src/components/type-parameters/type-parameters.test.tsx +4 -4
  332. package/src/components/var/declaration.test.tsx +8 -14
  333. package/src/components/var/declaration.tsx +12 -6
  334. package/src/contexts/format-options.ts +14 -0
  335. package/src/contexts/global-namespace.ts +29 -0
  336. package/src/contexts/namespace.ts +13 -0
  337. package/src/index.ts +2 -0
  338. package/src/modifiers.ts +14 -0
  339. package/src/scopes/class.ts +12 -0
  340. package/src/scopes/contexts.ts +45 -0
  341. package/src/scopes/csharp.ts +23 -0
  342. package/src/scopes/factories.ts +45 -0
  343. package/src/scopes/index.ts +9 -0
  344. package/src/scopes/lexical.ts +10 -0
  345. package/src/scopes/method.ts +22 -0
  346. package/src/scopes/named-type.ts +44 -0
  347. package/src/scopes/namespace.ts +59 -0
  348. package/src/scopes/source-file.ts +67 -0
  349. package/src/symbols/csharp.ts +339 -0
  350. package/src/symbols/factories.ts +215 -0
  351. package/src/symbols/index.ts +5 -2
  352. package/src/symbols/method.ts +26 -0
  353. package/src/symbols/named-type.ts +54 -0
  354. package/src/symbols/namespace.ts +62 -0
  355. package/src/symbols/reference.tsx +64 -0
  356. package/temp/api.json +6910 -2491
  357. package/test/project-directory.test.tsx +14 -16
  358. package/test/using.test.tsx +21 -21
  359. package/test/utils.tsx +2 -1
  360. package/tsconfig.json +4 -1
  361. package/tsdoc-metadata.json +1 -1
  362. package/dist/src/components/ClassDeclaration.d.ts.map +0 -1
  363. package/dist/src/components/ClassDeclaration.js +0 -92
  364. package/dist/src/components/EnumDeclaration.d.ts.map +0 -1
  365. package/dist/src/components/EnumDeclaration.js +0 -85
  366. package/dist/src/components/Namespace.d.ts +0 -11
  367. package/dist/src/components/Namespace.d.ts.map +0 -1
  368. package/dist/src/components/Namespace.js +0 -33
  369. package/dist/src/components/SourceFile.d.ts +0 -14
  370. package/dist/src/components/SourceFile.d.ts.map +0 -1
  371. package/dist/src/components/SourceFile.js +0 -69
  372. package/dist/src/symbols/csharp-output-symbol.d.ts +0 -8
  373. package/dist/src/symbols/csharp-output-symbol.d.ts.map +0 -1
  374. package/dist/src/symbols/csharp-output-symbol.js +0 -19
  375. package/dist/src/symbols/scopes.d.ts +0 -14
  376. package/dist/src/symbols/scopes.d.ts.map +0 -1
  377. package/dist/src/symbols/scopes.js +0 -31
  378. package/dist/test/class-declaration.test.d.ts +0 -2
  379. package/dist/test/class-declaration.test.d.ts.map +0 -1
  380. package/dist/test/class-declaration.test.js +0 -484
  381. package/dist/test/enum.test.d.ts +0 -2
  382. package/dist/test/enum.test.d.ts.map +0 -1
  383. package/dist/test/enum.test.js +0 -178
  384. package/dist/test/namespace.test.d.ts.map +0 -1
  385. package/dist/test/namespace.test.js +0 -81
  386. package/dist/test/sourcefile.test.d.ts +0 -2
  387. package/dist/test/sourcefile.test.d.ts.map +0 -1
  388. package/dist/test/sourcefile.test.js +0 -58
  389. package/src/components/EnumDeclaration.tsx +0 -99
  390. package/src/components/Namespace.tsx +0 -35
  391. package/src/components/SourceFile.tsx +0 -78
  392. package/src/symbols/csharp-output-symbol.ts +0 -22
  393. package/src/symbols/reference.ts +0 -65
  394. package/src/symbols/scopes.ts +0 -41
  395. package/test/class-declaration.test.tsx +0 -413
  396. package/test/enum.test.tsx +0 -149
  397. package/test/namespace.test.tsx +0 -55
  398. package/test/sourcefile.test.tsx +0 -47
  399. /package/dist/{test → src/components}/namespace.test.d.ts +0 -0
@@ -0,0 +1,484 @@
1
+ import { Constructor } from "#components/constructor/constructor.jsx";
2
+ import { EnumDeclaration } from "#components/enum/declaration.jsx";
3
+ import { EnumMember } from "#components/enum/member.jsx";
4
+ import {
5
+ Children,
6
+ code,
7
+ createNamePolicy,
8
+ List,
9
+ NamePolicyContext,
10
+ Output,
11
+ refkey,
12
+ } from "@alloy-js/core";
13
+ import * as coretest from "@alloy-js/core/testing";
14
+ import { describe, expect, it } from "vitest";
15
+ import { TestNamespace, toSourceText } from "../../../test/utils.jsx";
16
+ import { createCSharpNamePolicy } from "../../name-policy.js";
17
+ import { Attribute } from "../attributes/attributes.jsx";
18
+ import { Field } from "../field/field.jsx";
19
+ import { Method } from "../method/method.jsx";
20
+ import { Property } from "../property/property.jsx";
21
+ import { SourceFile } from "../source-file/source-file.jsx";
22
+ import { TypeParameterProps } from "../type-parameters/type-parameter.jsx";
23
+ import { ClassDeclaration } from "./declaration.jsx";
24
+
25
+ function Wrapper({ children }: { children: Children }) {
26
+ return <TestNamespace>{children}</TestNamespace>;
27
+ }
28
+
29
+ it("declares class with no members", () => {
30
+ expect(
31
+ <TestNamespace>
32
+ <ClassDeclaration name="TestClass" />
33
+ </TestNamespace>,
34
+ ).toRenderTo(`
35
+ class TestClass;
36
+ `);
37
+ });
38
+
39
+ describe("modifiers", () => {
40
+ it.each(["public", "private"])("%s", (mod) => {
41
+ expect(
42
+ <TestNamespace>
43
+ <ClassDeclaration {...{ [mod]: true }} name="TestClass" />
44
+ </TestNamespace>,
45
+ ).toRenderTo(`
46
+ ${mod} class TestClass;
47
+ `);
48
+ });
49
+
50
+ it.each(["partial", "abstract", "static", "sealed"])("%s", (mod) => {
51
+ expect(
52
+ <TestNamespace>
53
+ <ClassDeclaration {...{ [mod]: true }} name="TestClass" />
54
+ </TestNamespace>,
55
+ ).toRenderTo(`
56
+ ${mod} class TestClass;
57
+ `);
58
+ });
59
+
60
+ it("combines modifiers", () => {
61
+ expect(
62
+ <TestNamespace>
63
+ <ClassDeclaration public abstract partial name="TestClass" />
64
+ </TestNamespace>,
65
+ ).toRenderTo(`
66
+ public abstract partial class TestClass;
67
+ `);
68
+ });
69
+
70
+ it("places visibility, attributes, and modifiers in the correct order", () => {
71
+ expect(
72
+ <TestNamespace>
73
+ <ClassDeclaration
74
+ partial
75
+ public
76
+ abstract
77
+ sealed
78
+ name="TestClass"
79
+ attributes={[<Attribute name="Test" />]}
80
+ />
81
+ </TestNamespace>,
82
+ ).toRenderTo(`
83
+ [Test]
84
+ public abstract sealed partial class TestClass;
85
+ `);
86
+ });
87
+ });
88
+
89
+ describe("base", () => {
90
+ it("define base class", () => {
91
+ expect(
92
+ <TestNamespace>
93
+ <ClassDeclaration name="TestClass" baseType="Foo" />
94
+ </TestNamespace>,
95
+ ).toRenderTo(`
96
+ class TestClass : Foo;
97
+ `);
98
+ });
99
+
100
+ it("define multiple interface types", () => {
101
+ expect(
102
+ <TestNamespace>
103
+ <ClassDeclaration name="TestClass" interfaceTypes={["Foo", "Bar"]} />
104
+ </TestNamespace>,
105
+ ).toRenderTo(`
106
+ class TestClass : Foo, Bar;
107
+ `);
108
+ });
109
+
110
+ it("define base class and multiple interface types", () => {
111
+ expect(
112
+ <TestNamespace>
113
+ <ClassDeclaration
114
+ name="TestClass"
115
+ baseType="BaseClass"
116
+ interfaceTypes={["Foo", "Bar"]}
117
+ />
118
+ </TestNamespace>,
119
+ ).toRenderTo(`
120
+ class TestClass : BaseClass, Foo, Bar;
121
+ `);
122
+ });
123
+ });
124
+
125
+ it("declares class with some members", () => {
126
+ const tree = (
127
+ <TestNamespace>
128
+ <ClassDeclaration public name="TestClass">
129
+ <List>
130
+ <Field public name="MemberOne" type="string" />
131
+ <Field public name="MemberTwo" type="int" />
132
+ </List>
133
+ </ClassDeclaration>
134
+ </TestNamespace>
135
+ );
136
+
137
+ expect(tree).toRenderTo(coretest.d`
138
+ public class TestClass
139
+ {
140
+ public string MemberOne;
141
+ public int MemberTwo;
142
+ }
143
+ `);
144
+ });
145
+
146
+ it("declares class with some methods", () => {
147
+ const tree = (
148
+ <TestNamespace>
149
+ <ClassDeclaration public name="TestClass">
150
+ <List>
151
+ <Method public name="MethodOne" />
152
+ <Method private virtual name="MethodTwo" />
153
+ </List>
154
+ </ClassDeclaration>
155
+ </TestNamespace>
156
+ );
157
+
158
+ expect(tree).toRenderTo(coretest.d`
159
+ public class TestClass
160
+ {
161
+ public void MethodOne() {}
162
+ private virtual void MethodTwo() {}
163
+ }
164
+ `);
165
+ });
166
+
167
+ it("uses refkeys for members, params, and return type", () => {
168
+ const inputTypeRefkey = refkey();
169
+ const testResultTypeRefkey = refkey();
170
+ const enumTypeRefkey = refkey();
171
+
172
+ const params = [
173
+ {
174
+ name: "IntParam",
175
+ type: "int",
176
+ },
177
+ {
178
+ name: "BodyParam",
179
+ type: inputTypeRefkey,
180
+ },
181
+ ];
182
+
183
+ expect(
184
+ <Output namePolicy={createCSharpNamePolicy()}>
185
+ <SourceFile path="Test.cs">
186
+ <EnumDeclaration public name="TestEnum" refkey={enumTypeRefkey}>
187
+ <List comma hardline>
188
+ <EnumMember name="One" />
189
+ <EnumMember name="Two" />
190
+ </List>
191
+ </EnumDeclaration>
192
+ <hbr />
193
+ <ClassDeclaration public name="TestInput" refkey={inputTypeRefkey} />
194
+ <hbr />
195
+ <ClassDeclaration
196
+ public
197
+ name="TestResult"
198
+ refkey={testResultTypeRefkey}
199
+ />
200
+ <hbr />
201
+ <ClassDeclaration public name="TestClass">
202
+ <Field private name="MemberOne" type={enumTypeRefkey} />
203
+ <hbr />
204
+ <Method
205
+ public
206
+ name="MethodOne"
207
+ parameters={params}
208
+ returns={testResultTypeRefkey}
209
+ >
210
+ return new {testResultTypeRefkey}();
211
+ </Method>
212
+ </ClassDeclaration>
213
+ </SourceFile>
214
+ </Output>,
215
+ ).toRenderTo(`
216
+ public enum TestEnum
217
+ {
218
+ One,
219
+ Two
220
+ }
221
+ public class TestInput;
222
+ public class TestResult;
223
+ public class TestClass
224
+ {
225
+ private TestEnum _memberOne;
226
+ public TestResult MethodOne(int intParam, TestInput bodyParam)
227
+ {
228
+ return new TestResult();
229
+ }
230
+ }
231
+ `);
232
+ });
233
+
234
+ describe("with type parameters", () => {
235
+ it("reference parameters", () => {
236
+ const typeParameters: TypeParameterProps[] = [
237
+ {
238
+ name: "T",
239
+ refkey: refkey(),
240
+ },
241
+ {
242
+ name: "U",
243
+ refkey: refkey(),
244
+ },
245
+ ];
246
+
247
+ expect(
248
+ <TestNamespace>
249
+ <ClassDeclaration
250
+ public
251
+ name="TestClass"
252
+ typeParameters={typeParameters}
253
+ >
254
+ <List>
255
+ <Property name="PropA" type={typeParameters[0].refkey} get set />
256
+ <Property name="PropB" type={typeParameters[1].refkey} get set />
257
+ </List>
258
+ </ClassDeclaration>
259
+ </TestNamespace>,
260
+ ).toRenderTo(`
261
+ public class TestClass<T, U>
262
+ {
263
+ T PropA { get; set; }
264
+ U PropB { get; set; }
265
+ }
266
+ `);
267
+ });
268
+
269
+ it("defines with constraints", () => {
270
+ const typeParameters: TypeParameterProps[] = [
271
+ {
272
+ name: "T",
273
+ constraints: "IFoo",
274
+ },
275
+ {
276
+ name: "U",
277
+ constraints: "IBar",
278
+ },
279
+ ];
280
+
281
+ expect(
282
+ <TestNamespace>
283
+ <ClassDeclaration
284
+ public
285
+ name="TestClass"
286
+ typeParameters={typeParameters}
287
+ >
288
+ // Body
289
+ </ClassDeclaration>
290
+ </TestNamespace>,
291
+ ).toRenderTo(`
292
+ public class TestClass<T, U>
293
+ where T : IFoo
294
+ where U : IBar
295
+ {
296
+ // Body
297
+ }
298
+ `);
299
+ });
300
+ });
301
+
302
+ it("declares class with invalid members", () => {
303
+ const decl = (
304
+ <ClassDeclaration public name="TestClass">
305
+ <EnumMember name="One" />,<hbr />
306
+ <EnumMember name="Two" />
307
+ </ClassDeclaration>
308
+ );
309
+
310
+ expect(() => toSourceText(decl)).toThrow(
311
+ "EnumMember must be used within an EnumDeclaration.",
312
+ );
313
+ });
314
+
315
+ describe("constructor", () => {
316
+ it("declares with constructor", () => {
317
+ const tree = (
318
+ <TestNamespace>
319
+ <ClassDeclaration public name="TestClass">
320
+ <Constructor public />
321
+ </ClassDeclaration>
322
+ </TestNamespace>
323
+ );
324
+
325
+ expect(tree).toRenderTo(coretest.d`
326
+ public class TestClass
327
+ {
328
+ public TestClass() {}
329
+ }
330
+ `);
331
+ });
332
+
333
+ it("declares with constructor params and assigns values to fields", () => {
334
+ const thisNameRefkey = refkey();
335
+ const thisSizeRefkey = refkey();
336
+ const paramNameRefkey = refkey();
337
+ const paramSizeRefkey = refkey();
338
+
339
+ const ctorParams = [
340
+ {
341
+ name: "name",
342
+ type: "string",
343
+ refkey: paramNameRefkey,
344
+ },
345
+ {
346
+ name: "size",
347
+ type: "int",
348
+ refkey: paramSizeRefkey,
349
+ },
350
+ ];
351
+
352
+ const tree = (
353
+ <TestNamespace>
354
+ <ClassDeclaration public name="TestClass">
355
+ <Field private name="name" type="string" refkey={thisNameRefkey} />
356
+ <hbr />
357
+ <Field private name="size" type="int" refkey={thisSizeRefkey} />
358
+ <hbr />
359
+ <Constructor public parameters={ctorParams}>
360
+ {thisNameRefkey} = {paramNameRefkey};<hbr />
361
+ {thisSizeRefkey} = {paramSizeRefkey};
362
+ </Constructor>
363
+ </ClassDeclaration>
364
+ </TestNamespace>
365
+ );
366
+
367
+ // TODO: assignments to members should have this. prefix
368
+ // e.g. this.name = name;
369
+ expect(tree).toRenderTo(coretest.d`
370
+ public class TestClass
371
+ {
372
+ private string _name;
373
+ private int _size;
374
+ public TestClass(string name, int size)
375
+ {
376
+ _name = name;
377
+ _size = size;
378
+ }
379
+ }
380
+ `);
381
+ });
382
+
383
+ it("declares primary constructor with args", () => {
384
+ const paramNameRefkey = refkey();
385
+ const paramSizeRefkey = refkey();
386
+
387
+ const ctorParams = [
388
+ {
389
+ name: "name",
390
+ type: "string",
391
+ refkey: paramNameRefkey,
392
+ },
393
+ {
394
+ name: "size",
395
+ type: "int",
396
+ refkey: paramSizeRefkey,
397
+ },
398
+ ];
399
+
400
+ expect(
401
+ <Wrapper>
402
+ <ClassDeclaration
403
+ public
404
+ name="TestClass"
405
+ primaryConstructor={ctorParams}
406
+ >
407
+ <Property
408
+ name="PrettyName"
409
+ type="string"
410
+ get
411
+ initializer={code`$"{${paramNameRefkey}} {${paramSizeRefkey}}"`}
412
+ />
413
+ </ClassDeclaration>
414
+ </Wrapper>,
415
+ ).toRenderTo(`
416
+ public class TestClass(string name, int size)
417
+ {
418
+ string PrettyName { get; } = $"{name} {size}";
419
+ }
420
+ `);
421
+ });
422
+
423
+ it("primary constructor params conflict with method", () => {
424
+ const ctorParams = [{ name: "name", type: "string" }];
425
+
426
+ expect(
427
+ <Wrapper>
428
+ <NamePolicyContext.Provider value={createNamePolicy((x) => x)}>
429
+ <ClassDeclaration
430
+ public
431
+ name="TestClass"
432
+ primaryConstructor={ctorParams}
433
+ >
434
+ <Field name="name" type="string" />
435
+ </ClassDeclaration>
436
+ </NamePolicyContext.Provider>
437
+ </Wrapper>,
438
+ ).toRenderTo(`
439
+ public class TestClass(string name)
440
+ {
441
+ string name_2;
442
+ }
443
+ `);
444
+ });
445
+ });
446
+
447
+ it("specify doc comment", () => {
448
+ expect(
449
+ <TestNamespace>
450
+ <ClassDeclaration name="Test" doc="This is a test" />
451
+ </TestNamespace>,
452
+ ).toRenderTo(`
453
+ /// This is a test
454
+ class Test;
455
+ `);
456
+ });
457
+
458
+ it("supports class member doc comments", () => {
459
+ expect(
460
+ <TestNamespace>
461
+ <ClassDeclaration name="Test" doc="This is a test">
462
+ <Field name="Member" public type="int" doc="This is a member" />
463
+ </ClassDeclaration>
464
+ </TestNamespace>,
465
+ ).toRenderTo(`
466
+ /// This is a test
467
+ class Test
468
+ {
469
+ /// This is a member
470
+ public int Member;
471
+ }
472
+ `);
473
+ });
474
+
475
+ it("specify attributes", () => {
476
+ expect(
477
+ <TestNamespace>
478
+ <ClassDeclaration name="Test" attributes={[<Attribute name="Test" />]} />
479
+ </TestNamespace>,
480
+ ).toRenderTo(`
481
+ [Test]
482
+ class Test;
483
+ `);
484
+ });
@@ -1,20 +1,28 @@
1
- import * as core from "@alloy-js/core";
2
- import { join } from "@alloy-js/core";
1
+ import {
2
+ Block,
3
+ Children,
4
+ Declaration,
5
+ DeclarationProps,
6
+ join,
7
+ Name,
8
+ Namekey,
9
+ Refkey,
10
+ Scope,
11
+ } from "@alloy-js/core";
3
12
  import {
4
13
  AccessModifiers,
5
14
  computeModifiersPrefix,
6
15
  getAccessModifier,
7
16
  makeModifiers,
8
- } from "../modifiers.js";
9
- import { useCSharpNamePolicy } from "../name-policy.js";
10
- import { CSharpOutputSymbol } from "../symbols/csharp-output-symbol.js";
11
- import { CSharpMemberScope } from "../symbols/scopes.js";
12
- import { AttributeList, AttributesProp } from "./attributes/attributes.jsx";
13
- import { DocWhen } from "./doc/comment.jsx";
14
- import { Name } from "./Name.jsx";
15
- import { TypeParameterConstraints } from "./type-parameters/type-parameter-constraints.jsx";
16
- import { TypeParameterProps } from "./type-parameters/type-parameter.jsx";
17
- import { TypeParameters } from "./type-parameters/type-parameters.jsx";
17
+ } from "../../modifiers.js";
18
+ import { createClassScope } from "../../scopes/factories.js";
19
+ import { createNamedTypeSymbol } from "../../symbols/factories.js";
20
+ import { AttributeList, AttributesProp } from "../attributes/attributes.jsx";
21
+ import { DocWhen } from "../doc/comment.jsx";
22
+ import { ParameterProps, Parameters } from "../parameters/parameters.jsx";
23
+ import { TypeParameterConstraints } from "../type-parameters/type-parameter-constraints.jsx";
24
+ import { TypeParameterProps } from "../type-parameters/type-parameter.jsx";
25
+ import { TypeParameters } from "../type-parameters/type-parameters.jsx";
18
26
 
19
27
  export interface ClassModifiers {
20
28
  readonly abstract?: boolean;
@@ -25,20 +33,20 @@ export interface ClassModifiers {
25
33
 
26
34
  const getClassModifiers = makeModifiers<ClassModifiers>([
27
35
  "abstract",
28
- "partial",
29
36
  "sealed",
30
37
  "static",
38
+ "partial",
31
39
  ]);
32
40
 
33
41
  // properties for creating a class
34
42
  export interface ClassDeclarationProps
35
- extends Omit<core.DeclarationProps, "nameKind">,
43
+ extends Omit<DeclarationProps, "nameKind">,
36
44
  AccessModifiers,
37
45
  ClassModifiers {
38
- name: string;
46
+ name: string | Namekey;
39
47
  /** Doc comment */
40
- doc?: core.Children;
41
- refkey?: core.Refkey;
48
+ doc?: Children;
49
+ refkey?: Refkey;
42
50
 
43
51
  /**
44
52
  * Type parameters for the class
@@ -55,10 +63,10 @@ export interface ClassDeclarationProps
55
63
  typeParameters?: (string | TypeParameterProps)[];
56
64
 
57
65
  /** Base class that this class extends */
58
- baseType?: core.Children;
66
+ baseType?: Children;
59
67
 
60
68
  /** Interfaces this class implements */
61
- interfaceTypes?: core.Children[];
69
+ interfaceTypes?: Children[];
62
70
 
63
71
  /**
64
72
  * Define attributes to attach
@@ -77,6 +85,24 @@ export interface ClassDeclarationProps
77
85
  * ```
78
86
  */
79
87
  attributes?: AttributesProp;
88
+
89
+ /**
90
+ * Set the primary constructor parameters
91
+ * @example
92
+ * ```tsx
93
+ * <ClassDeclaration name="MyClass" primaryConstructor={[
94
+ * {name: "value", type: "int"}
95
+ * ]}>
96
+ * ```
97
+ * This will produce:
98
+ * ```csharp
99
+ * public class MyClass(int value)
100
+ * {
101
+ *
102
+ * }
103
+ * ```
104
+ */
105
+ primaryConstructor?: ParameterProps[];
80
106
  }
81
107
 
82
108
  /**
@@ -104,19 +130,11 @@ export interface ClassDeclarationProps
104
130
  * ```
105
131
  */
106
132
  export function ClassDeclaration(props: ClassDeclarationProps) {
107
- const name = useCSharpNamePolicy().getName(props.name!, "class");
108
-
109
- const thisClassSymbol = new CSharpOutputSymbol(name, {
133
+ const thisClassSymbol = createNamedTypeSymbol(props.name, "class", {
110
134
  refkeys: props.refkey,
111
135
  });
112
136
 
113
- // this creates a new scope for the class definition.
114
- // members will automatically "inherit" this scope so
115
- // that refkeys to them will produce the fully-qualified
116
- // name e.g. Foo.Bar.
117
- const thisClassScope = new CSharpMemberScope("class-decl", {
118
- owner: thisClassSymbol,
119
- });
137
+ const thisClassScope = createClassScope(thisClassSymbol);
120
138
 
121
139
  const bases = [
122
140
  ...(props.baseType ? [props.baseType] : []),
@@ -129,23 +147,24 @@ export function ClassDeclaration(props: ClassDeclarationProps) {
129
147
  getClassModifiers(props),
130
148
  ]);
131
149
  return (
132
- <core.Declaration symbol={thisClassSymbol}>
150
+ <Declaration symbol={thisClassSymbol}>
133
151
  <DocWhen doc={props.doc} />
134
152
  <AttributeList attributes={props.attributes} endline />
135
153
  {modifiers}class <Name />
136
- {props.typeParameters && (
137
- <TypeParameters parameters={props.typeParameters} />
138
- )}
139
- {base}
140
- {props.typeParameters && (
141
- <TypeParameterConstraints parameters={props.typeParameters} />
142
- )}
143
- {!props.children && ";"}
144
- {props.children && (
145
- <core.Block newline>
146
- <core.Scope value={thisClassScope}>{props.children}</core.Scope>
147
- </core.Block>
148
- )}
149
- </core.Declaration>
154
+ <Scope value={thisClassScope}>
155
+ {props.typeParameters && (
156
+ <TypeParameters parameters={props.typeParameters} />
157
+ )}
158
+ {props.primaryConstructor && (
159
+ <Parameters parameters={props.primaryConstructor} />
160
+ )}
161
+ {base}
162
+ {props.typeParameters && (
163
+ <TypeParameterConstraints parameters={props.typeParameters} />
164
+ )}
165
+ {!props.children && ";"}
166
+ {props.children && <Block newline>{props.children}</Block>}
167
+ </Scope>
168
+ </Declaration>
150
169
  );
151
170
  }
@@ -1,8 +1,7 @@
1
1
  import { refkey } from "@alloy-js/core";
2
2
  import { expect, it } from "vitest";
3
3
  import { TestNamespace } from "../../../test/utils.jsx";
4
- import { ClassDeclaration } from "../ClassDeclaration.jsx";
5
- import { SourceFile } from "../SourceFile.jsx";
4
+ import { ClassDeclaration } from "../class/declaration.jsx";
6
5
  import { Constructor } from "./constructor.jsx";
7
6
 
8
7
  it("reference constructor parameters in body", () => {
@@ -16,25 +15,20 @@ it("reference constructor parameters in body", () => {
16
15
 
17
16
  expect(
18
17
  <TestNamespace>
19
- <SourceFile path="Test.cs">
20
- <ClassDeclaration public name="TestClass">
21
- <Constructor public parameters={ctorParams}>
22
- {paramNameRefkey};<hbr />
23
- {paramSizeRefkey};
24
- </Constructor>
25
- </ClassDeclaration>
26
- </SourceFile>
18
+ <ClassDeclaration public name="TestClass">
19
+ <Constructor public parameters={ctorParams}>
20
+ {paramNameRefkey};<hbr />
21
+ {paramSizeRefkey};
22
+ </Constructor>
23
+ </ClassDeclaration>
27
24
  </TestNamespace>,
28
25
  ).toRenderTo(`
29
- namespace TestCode
26
+ public class TestClass
30
27
  {
31
- public class TestClass
28
+ public TestClass(string name, int size)
32
29
  {
33
- public TestClass(string name, int size)
34
- {
35
- name;
36
- size;
37
- }
30
+ name;
31
+ size;
38
32
  }
39
33
  }
40
34
  `);