@alloy-js/csharp 0.18.0-dev.24 → 0.18.0-dev.4

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 (166) hide show
  1. package/dist/src/components/Class.d.ts +23 -0
  2. package/dist/src/components/Class.d.ts.map +1 -0
  3. package/dist/src/components/{ClassDeclaration.js → Class.js} +37 -67
  4. package/dist/src/components/ClassMethod.d.ts +3 -44
  5. package/dist/src/components/ClassMethod.d.ts.map +1 -1
  6. package/dist/src/components/ClassMethod.js +8 -32
  7. package/dist/src/components/Enum.d.ts +14 -0
  8. package/dist/src/components/Enum.d.ts.map +1 -0
  9. package/dist/src/components/{EnumDeclaration.js → Enum.js} +2 -21
  10. package/dist/src/components/Parameters.d.ts +13 -0
  11. package/dist/src/components/Parameters.d.ts.map +1 -0
  12. package/dist/src/components/Parameters.js +34 -0
  13. package/dist/src/components/SourceFile.d.ts.map +1 -1
  14. package/dist/src/components/SourceFile.js +0 -1
  15. package/dist/src/components/index.d.ts +4 -14
  16. package/dist/src/components/index.d.ts.map +1 -1
  17. package/dist/src/components/index.js +5 -15
  18. package/dist/src/components/stc/index.d.ts +2 -2
  19. package/dist/src/components/stc/index.d.ts.map +1 -1
  20. package/dist/src/components/stc/index.js +2 -2
  21. package/dist/src/modifiers.d.ts +9 -2
  22. package/dist/src/modifiers.d.ts.map +1 -1
  23. package/dist/src/modifiers.js +9 -6
  24. package/dist/src/name-policy.d.ts +1 -1
  25. package/dist/src/name-policy.d.ts.map +1 -1
  26. package/dist/src/name-policy.js +0 -2
  27. package/dist/test/class-method.test.js +2 -23
  28. package/dist/test/class.test.d.ts +2 -0
  29. package/dist/test/class.test.d.ts.map +1 -0
  30. package/dist/test/{class-declaration.test.js → class.test.js} +51 -234
  31. package/dist/test/enum.test.js +6 -6
  32. package/dist/test/namespace.test.js +4 -4
  33. package/dist/test/projectdirectory.test.d.ts +2 -0
  34. package/dist/test/projectdirectory.test.d.ts.map +1 -0
  35. package/dist/test/{project-directory.test.js → projectdirectory.test.js} +4 -4
  36. package/dist/test/sourcefile.test.js +2 -2
  37. package/dist/test/using.test.js +4 -4
  38. package/dist/tsconfig.tsbuildinfo +1 -1
  39. package/package.json +3 -4
  40. package/src/components/{ClassDeclaration.tsx → Class.tsx} +38 -116
  41. package/src/components/ClassMethod.tsx +7 -70
  42. package/src/components/{EnumDeclaration.tsx → Enum.tsx} +3 -22
  43. package/src/components/Parameters.tsx +51 -0
  44. package/src/components/SourceFile.tsx +0 -1
  45. package/src/components/index.ts +4 -14
  46. package/src/components/stc/index.ts +2 -2
  47. package/src/modifiers.ts +30 -16
  48. package/src/name-policy.ts +0 -5
  49. package/temp/api.json +1194 -6218
  50. package/test/class-method.test.tsx +3 -19
  51. package/test/class.test.tsx +257 -0
  52. package/test/enum.test.tsx +11 -13
  53. package/test/namespace.test.tsx +4 -4
  54. package/test/{project-directory.test.tsx → projectdirectory.test.tsx} +4 -4
  55. package/test/sourcefile.test.tsx +2 -2
  56. package/test/using.test.tsx +6 -14
  57. package/vitest.config.ts +0 -3
  58. package/dist/src/components/ClassDeclaration.d.ts +0 -92
  59. package/dist/src/components/ClassDeclaration.d.ts.map +0 -1
  60. package/dist/src/components/EnumDeclaration.d.ts +0 -34
  61. package/dist/src/components/EnumDeclaration.d.ts.map +0 -1
  62. package/dist/src/components/attributes/attributes.d.ts +0 -39
  63. package/dist/src/components/attributes/attributes.d.ts.map +0 -1
  64. package/dist/src/components/attributes/attributes.js +0 -62
  65. package/dist/src/components/attributes/attributes.test.d.ts +0 -2
  66. package/dist/src/components/attributes/attributes.test.d.ts.map +0 -1
  67. package/dist/src/components/attributes/attributes.test.js +0 -75
  68. package/dist/src/components/doc/comment.d.ts +0 -70
  69. package/dist/src/components/doc/comment.d.ts.map +0 -1
  70. package/dist/src/components/doc/comment.js +0 -88
  71. package/dist/src/components/doc/comment.test.d.ts +0 -2
  72. package/dist/src/components/doc/comment.test.d.ts.map +0 -1
  73. package/dist/src/components/doc/comment.test.js +0 -348
  74. package/dist/src/components/doc/from-markdown.d.ts +0 -6
  75. package/dist/src/components/doc/from-markdown.d.ts.map +0 -1
  76. package/dist/src/components/doc/from-markdown.js +0 -58
  77. package/dist/src/components/doc/from-markdown.test.d.ts +0 -2
  78. package/dist/src/components/doc/from-markdown.test.d.ts.map +0 -1
  79. package/dist/src/components/doc/from-markdown.test.js +0 -83
  80. package/dist/src/components/interface/declaration.d.ts +0 -65
  81. package/dist/src/components/interface/declaration.d.ts.map +0 -1
  82. package/dist/src/components/interface/declaration.js +0 -83
  83. package/dist/src/components/interface/declaration.test.d.ts +0 -2
  84. package/dist/src/components/interface/declaration.test.d.ts.map +0 -1
  85. package/dist/src/components/interface/declaration.test.js +0 -171
  86. package/dist/src/components/interface/method.d.ts +0 -50
  87. package/dist/src/components/interface/method.d.ts.map +0 -1
  88. package/dist/src/components/interface/method.js +0 -74
  89. package/dist/src/components/interface/method.test.d.ts +0 -2
  90. package/dist/src/components/interface/method.test.d.ts.map +0 -1
  91. package/dist/src/components/interface/method.test.js +0 -300
  92. package/dist/src/components/interface/property.d.ts +0 -56
  93. package/dist/src/components/interface/property.d.ts.map +0 -1
  94. package/dist/src/components/interface/property.js +0 -73
  95. package/dist/src/components/interface/property.test.d.ts +0 -2
  96. package/dist/src/components/interface/property.test.d.ts.map +0 -1
  97. package/dist/src/components/interface/property.test.js +0 -189
  98. package/dist/src/components/parameters/parameters.d.ts +0 -19
  99. package/dist/src/components/parameters/parameters.d.ts.map +0 -1
  100. package/dist/src/components/parameters/parameters.js +0 -43
  101. package/dist/src/components/property/property.d.ts +0 -80
  102. package/dist/src/components/property/property.d.ts.map +0 -1
  103. package/dist/src/components/property/property.js +0 -76
  104. package/dist/src/components/property/property.test.d.ts +0 -2
  105. package/dist/src/components/property/property.test.d.ts.map +0 -1
  106. package/dist/src/components/property/property.test.js +0 -242
  107. package/dist/src/components/record/declaration.d.ts +0 -35
  108. package/dist/src/components/record/declaration.d.ts.map +0 -1
  109. package/dist/src/components/record/declaration.js +0 -90
  110. package/dist/src/components/record/declaration.test.d.ts +0 -2
  111. package/dist/src/components/record/declaration.test.d.ts.map +0 -1
  112. package/dist/src/components/record/declaration.test.js +0 -94
  113. package/dist/src/components/type-parameters/type-parameter-constraints.d.ts +0 -8
  114. package/dist/src/components/type-parameters/type-parameter-constraints.d.ts.map +0 -1
  115. package/dist/src/components/type-parameters/type-parameter-constraints.js +0 -44
  116. package/dist/src/components/type-parameters/type-parameter-constraints.test.d.ts +0 -2
  117. package/dist/src/components/type-parameters/type-parameter-constraints.test.d.ts.map +0 -1
  118. package/dist/src/components/type-parameters/type-parameter-constraints.test.js +0 -67
  119. package/dist/src/components/type-parameters/type-parameter.d.ts +0 -20
  120. package/dist/src/components/type-parameters/type-parameter.d.ts.map +0 -1
  121. package/dist/src/components/type-parameters/type-parameter.js +0 -22
  122. package/dist/src/components/type-parameters/type-parameters.d.ts +0 -17
  123. package/dist/src/components/type-parameters/type-parameters.d.ts.map +0 -1
  124. package/dist/src/components/type-parameters/type-parameters.js +0 -54
  125. package/dist/src/components/type-parameters/type-parameters.test.d.ts +0 -2
  126. package/dist/src/components/type-parameters/type-parameters.test.d.ts.map +0 -1
  127. package/dist/src/components/type-parameters/type-parameters.test.js +0 -48
  128. package/dist/src/components/var/declaration.d.ts +0 -35
  129. package/dist/src/components/var/declaration.d.ts.map +0 -1
  130. package/dist/src/components/var/declaration.js +0 -40
  131. package/dist/src/components/var/declaration.test.d.ts +0 -2
  132. package/dist/src/components/var/declaration.test.d.ts.map +0 -1
  133. package/dist/src/components/var/declaration.test.js +0 -73
  134. package/dist/test/class-declaration.test.d.ts +0 -2
  135. package/dist/test/class-declaration.test.d.ts.map +0 -1
  136. package/dist/test/project-directory.test.d.ts +0 -2
  137. package/dist/test/project-directory.test.d.ts.map +0 -1
  138. package/dist/test/vitest.setup.d.ts +0 -2
  139. package/dist/test/vitest.setup.d.ts.map +0 -1
  140. package/dist/test/vitest.setup.js +0 -1
  141. package/src/components/attributes/attributes.test.tsx +0 -61
  142. package/src/components/attributes/attributes.tsx +0 -100
  143. package/src/components/doc/comment.test.tsx +0 -337
  144. package/src/components/doc/comment.tsx +0 -152
  145. package/src/components/doc/from-markdown.test.tsx +0 -103
  146. package/src/components/doc/from-markdown.tsx +0 -58
  147. package/src/components/interface/declaration.test.tsx +0 -158
  148. package/src/components/interface/declaration.tsx +0 -125
  149. package/src/components/interface/method.test.tsx +0 -293
  150. package/src/components/interface/method.tsx +0 -122
  151. package/src/components/interface/property.test.tsx +0 -165
  152. package/src/components/interface/property.tsx +0 -127
  153. package/src/components/parameters/parameters.tsx +0 -74
  154. package/src/components/property/property.test.tsx +0 -209
  155. package/src/components/property/property.tsx +0 -172
  156. package/src/components/record/declaration.test.tsx +0 -73
  157. package/src/components/record/declaration.tsx +0 -109
  158. package/src/components/type-parameters/type-parameter-constraints.test.tsx +0 -93
  159. package/src/components/type-parameters/type-parameter-constraints.tsx +0 -46
  160. package/src/components/type-parameters/type-parameter.tsx +0 -35
  161. package/src/components/type-parameters/type-parameters.test.tsx +0 -46
  162. package/src/components/type-parameters/type-parameters.tsx +0 -63
  163. package/src/components/var/declaration.test.tsx +0 -59
  164. package/src/components/var/declaration.tsx +0 -47
  165. package/test/class-declaration.test.tsx +0 -430
  166. package/test/vitest.setup.ts +0 -1
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=class.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"class.test.d.ts","sourceRoot":"","sources":["../../test/class.test.tsx"],"names":[],"mappings":""}
@@ -1,106 +1,23 @@
1
- import { createComponent as _$createComponent, mergeProps as _$mergeProps, createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
1
+ import { createComponent as _$createComponent, createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
2
2
  import * as core from "@alloy-js/core";
3
- import { List, refkey } from "@alloy-js/core";
4
3
  import * as coretest from "@alloy-js/core/testing";
5
- import { describe, expect, it } from "vitest";
6
- import { Attribute } from "../src/components/attributes/attributes.js";
4
+ import { expect, it } from "vitest";
7
5
  import * as csharp from "../src/index.js";
8
- import { ClassDeclaration, ClassMember, Property, SourceFile } from "../src/index.js";
9
6
  import * as utils from "./utils.js";
10
7
  it("declares class with no members", () => {
11
- expect(_$createComponent(utils.TestNamespace, {
12
- get children() {
13
- return _$createComponent(ClassDeclaration, {
14
- name: "TestClass"
15
- });
8
+ const res = utils.toSourceText(_$createComponent(csharp.Class, {
9
+ "public": true,
10
+ name: "TestClass"
11
+ }));
12
+ expect(res).toBe(coretest.d`
13
+ namespace TestCode
14
+ {
15
+ public class TestClass;
16
16
  }
17
- })).toRenderTo(`
18
- class TestClass;
19
17
  `);
20
18
  });
21
- describe("modifiers", () => {
22
- it.each(["public", "private"])("%s", mod => {
23
- expect(_$createComponent(utils.TestNamespace, {
24
- get children() {
25
- return _$createComponent(ClassDeclaration, _$mergeProps({
26
- [mod]: true
27
- }, {
28
- name: "TestClass"
29
- }));
30
- }
31
- })).toRenderTo(`
32
- ${mod} class TestClass;
33
- `);
34
- });
35
- it.each(["partial", "abstract", "static", "sealed"])("%s", mod => {
36
- expect(_$createComponent(utils.TestNamespace, {
37
- get children() {
38
- return _$createComponent(ClassDeclaration, _$mergeProps({
39
- [mod]: true
40
- }, {
41
- name: "TestClass"
42
- }));
43
- }
44
- })).toRenderTo(`
45
- ${mod} class TestClass;
46
- `);
47
- });
48
- it("combines modifiers", () => {
49
- expect(_$createComponent(utils.TestNamespace, {
50
- get children() {
51
- return _$createComponent(ClassDeclaration, {
52
- "public": true,
53
- abstract: true,
54
- partial: true,
55
- name: "TestClass"
56
- });
57
- }
58
- })).toRenderTo(`
59
- public abstract partial class TestClass;
60
- `);
61
- });
62
- });
63
- describe("base", () => {
64
- it("define base class", () => {
65
- expect(_$createComponent(utils.TestNamespace, {
66
- get children() {
67
- return _$createComponent(csharp.ClassDeclaration, {
68
- name: "TestClass",
69
- baseType: "Foo"
70
- });
71
- }
72
- })).toRenderTo(`
73
- class TestClass : Foo;
74
- `);
75
- });
76
- it("define multiple interface types", () => {
77
- expect(_$createComponent(utils.TestNamespace, {
78
- get children() {
79
- return _$createComponent(csharp.ClassDeclaration, {
80
- name: "TestClass",
81
- interfaceTypes: ["Foo", "Bar"]
82
- });
83
- }
84
- })).toRenderTo(`
85
- class TestClass : Foo, Bar;
86
- `);
87
- });
88
- it("define base class and multiple interface types", () => {
89
- expect(_$createComponent(utils.TestNamespace, {
90
- get children() {
91
- return _$createComponent(csharp.ClassDeclaration, {
92
- name: "TestClass",
93
- baseType: "BaseClass",
94
- interfaceTypes: ["Foo", "Bar"]
95
- });
96
- }
97
- })).toRenderTo(`
98
- class TestClass : BaseClass, Foo, Bar;
99
- `);
100
- });
101
- });
102
19
  it("declares class with some members", () => {
103
- const res = utils.toSourceText(_$createComponent(csharp.ClassDeclaration, {
20
+ const res = utils.toSourceText(_$createComponent(csharp.Class, {
104
21
  "public": true,
105
22
  name: "TestClass",
106
23
  get children() {
@@ -131,7 +48,7 @@ it("declares class with some members", () => {
131
48
  `);
132
49
  });
133
50
  it("declares class with some methods", () => {
134
- const res = utils.toSourceText(_$createComponent(csharp.ClassDeclaration, {
51
+ const res = utils.toSourceText(_$createComponent(csharp.Class, {
135
52
  "public": true,
136
53
  name: "TestClass",
137
54
  get children() {
@@ -182,7 +99,7 @@ it("uses refkeys for members, params, and return type", () => {
182
99
  return _$createComponent(csharp.SourceFile, {
183
100
  path: "Test.cs",
184
101
  get children() {
185
- return [_$createComponent(csharp.EnumDeclaration, {
102
+ return [_$createComponent(csharp.Enum, {
186
103
  "public": true,
187
104
  name: "TestEnum",
188
105
  refkey: enumTypeRefkey,
@@ -199,15 +116,15 @@ it("uses refkeys for members, params, and return type", () => {
199
116
  }
200
117
  });
201
118
  }
202
- }), _$createIntrinsic("hbr", {}), _$createComponent(csharp.ClassDeclaration, {
119
+ }), _$createIntrinsic("hbr", {}), _$createComponent(csharp.Class, {
203
120
  "public": true,
204
121
  name: "TestInput",
205
122
  refkey: inputTypeRefkey
206
- }), _$createIntrinsic("hbr", {}), _$createComponent(csharp.ClassDeclaration, {
123
+ }), _$createIntrinsic("hbr", {}), _$createComponent(csharp.Class, {
207
124
  "public": true,
208
125
  name: "TestResult",
209
126
  refkey: testResultTypeRefkey
210
- }), _$createIntrinsic("hbr", {}), _$createComponent(csharp.ClassDeclaration, {
127
+ }), _$createIntrinsic("hbr", {}), _$createComponent(csharp.Class, {
211
128
  "public": true,
212
129
  name: "TestClass",
213
130
  get children() {
@@ -253,89 +170,44 @@ it("uses refkeys for members, params, and return type", () => {
253
170
  }
254
171
  `);
255
172
  });
256
- describe("with type parameters", () => {
257
- it("reference parameters", () => {
258
- const typeParameters = [{
259
- name: "T",
260
- refkey: refkey()
261
- }, {
262
- name: "U",
263
- refkey: refkey()
264
- }];
265
- expect(_$createComponent(utils.TestNamespace, {
266
- get children() {
267
- return _$createComponent(SourceFile, {
268
- path: "Test.cs",
269
- get children() {
270
- return _$createComponent(ClassDeclaration, {
271
- "public": true,
272
- name: "TestClass",
273
- typeParameters: typeParameters,
274
- get children() {
275
- return _$createComponent(List, {
276
- get children() {
277
- return [_$createComponent(Property, {
278
- name: "PropA",
279
- get type() {
280
- return typeParameters[0].refkey;
281
- },
282
- get: true,
283
- set: true
284
- }), _$createComponent(Property, {
285
- name: "PropB",
286
- get type() {
287
- return typeParameters[1].refkey;
288
- },
289
- get: true,
290
- set: true
291
- })];
292
- }
293
- });
294
- }
295
- });
296
- }
297
- });
298
- }
299
- })).toRenderTo(`
300
- namespace TestCode
301
- {
173
+ it("declares class with generic parameters", () => {
174
+ const typeParameters = {
175
+ T: core.refkey(),
176
+ U: core.refkey()
177
+ };
178
+ const res = utils.toSourceText(_$createComponent(csharp.Class, {
179
+ "public": true,
180
+ name: "TestClass",
181
+ typeParameters: typeParameters,
182
+ get children() {
183
+ return [_$createComponent(csharp.ClassMember, {
184
+ "public": true,
185
+ name: "memberOne",
186
+ get type() {
187
+ return typeParameters.T;
188
+ }
189
+ }), ";", _$createIntrinsic("hbr", {}), _$createComponent(csharp.ClassMember, {
190
+ "private": true,
191
+ name: "memberTwo",
192
+ get type() {
193
+ return typeParameters.U;
194
+ }
195
+ }), ";"];
196
+ }
197
+ }));
198
+ expect(res).toBe(coretest.d`
199
+ namespace TestCode
200
+ {
302
201
  public class TestClass<T, U>
303
202
  {
304
- T PropA { get; set; }
305
- U PropB { get; set; }
203
+ public T MemberOne;
204
+ private U memberTwo;
306
205
  }
307
- }
308
- `);
309
- });
310
- it("defines with constraints", () => {
311
- const typeParameters = [{
312
- name: "T",
313
- constraints: "IFoo"
314
- }, {
315
- name: "U",
316
- constraints: "IBar"
317
- }];
318
- expect(_$createComponent(utils.TestNamespace, {
319
- get children() {
320
- return _$createComponent(ClassDeclaration, {
321
- "public": true,
322
- name: "TestClass",
323
- typeParameters: typeParameters,
324
- children: "// Body"
325
- });
326
- }
327
- })).toRenderTo(`
328
- public class TestClass<T, U>
329
- where T : IFoo
330
- where U : IBar
331
- {
332
- // Body
333
- }
334
- `);
335
- });
206
+ }
207
+ `);
336
208
  });
337
209
  it("declares class with invalid members", () => {
338
- const decl = _$createComponent(csharp.ClassDeclaration, {
210
+ const decl = _$createComponent(csharp.Class, {
339
211
  "public": true,
340
212
  name: "TestClass",
341
213
  get children() {
@@ -349,7 +221,7 @@ it("declares class with invalid members", () => {
349
221
  expect(() => utils.toSourceText(decl)).toThrow("can't define an enum member outside of an enum-decl scope");
350
222
  });
351
223
  it("declares class with constructor", () => {
352
- const res = utils.toSourceText(_$createComponent(csharp.ClassDeclaration, {
224
+ const res = utils.toSourceText(_$createComponent(csharp.Class, {
353
225
  "public": true,
354
226
  name: "TestClass",
355
227
  get children() {
@@ -382,7 +254,7 @@ it("declares class with constructor params and assigns values to fields", () =>
382
254
  type: "int",
383
255
  refkey: paramSizeRefkey
384
256
  }];
385
- const res = utils.toSourceText(_$createComponent(csharp.ClassDeclaration, {
257
+ const res = utils.toSourceText(_$createComponent(csharp.Class, {
386
258
  "public": true,
387
259
  name: "TestClass",
388
260
  get children() {
@@ -423,59 +295,4 @@ it("declares class with constructor params and assigns values to fields", () =>
423
295
  }
424
296
  }
425
297
  `);
426
- });
427
- it("specify doc comment", () => {
428
- expect(_$createComponent(utils.TestNamespace, {
429
- get children() {
430
- return _$createComponent(ClassDeclaration, {
431
- name: "Test",
432
- doc: "This is a test"
433
- });
434
- }
435
- })).toRenderTo(`
436
- /// This is a test
437
- class Test;
438
- `);
439
- });
440
- it("supports class member doc comments", () => {
441
- expect(_$createComponent(utils.TestNamespace, {
442
- get children() {
443
- return _$createComponent(ClassDeclaration, {
444
- name: "Test",
445
- doc: "This is a test",
446
- get children() {
447
- return _$createComponent(ClassMember, {
448
- name: "Member",
449
- "public": true,
450
- type: "int",
451
- doc: "This is a member"
452
- });
453
- }
454
- });
455
- }
456
- })).toRenderTo(`
457
- /// This is a test
458
- class Test
459
- {
460
- /// This is a member
461
- public int Member
462
- }
463
- `);
464
- });
465
- it("specify attributes", () => {
466
- expect(_$createComponent(utils.TestNamespace, {
467
- get children() {
468
- return _$createComponent(ClassDeclaration, {
469
- name: "Test",
470
- get attributes() {
471
- return [_$createComponent(Attribute, {
472
- name: "Test"
473
- })];
474
- }
475
- });
476
- }
477
- })).toRenderTo(`
478
- [Test]
479
- class Test;
480
- `);
481
298
  });
@@ -5,7 +5,7 @@ import { expect, it } from "vitest";
5
5
  import * as csharp from "../src/index.js";
6
6
  import * as utils from "./utils.js";
7
7
  it("declares enum with no members", () => {
8
- const res = utils.toSourceText(_$createComponent(csharp.EnumDeclaration, {
8
+ const res = utils.toSourceText(_$createComponent(csharp.Enum, {
9
9
  "public": true,
10
10
  name: "TestEnum"
11
11
  }));
@@ -17,7 +17,7 @@ it("declares enum with no members", () => {
17
17
  `);
18
18
  });
19
19
  it("declares enum with members", () => {
20
- const res = utils.toSourceText(_$createComponent(csharp.EnumDeclaration, {
20
+ const res = utils.toSourceText(_$createComponent(csharp.Enum, {
21
21
  "public": true,
22
22
  name: "TestEnum",
23
23
  get children() {
@@ -40,7 +40,7 @@ it("declares enum with members", () => {
40
40
  `);
41
41
  });
42
42
  it("applies naming policy to enum and members", () => {
43
- const res = utils.toSourceText(_$createComponent(csharp.EnumDeclaration, {
43
+ const res = utils.toSourceText(_$createComponent(csharp.Enum, {
44
44
  "public": true,
45
45
  name: "testEnum",
46
46
  get children() {
@@ -73,7 +73,7 @@ it("can reference things by refkey", () => {
73
73
  return _$createComponent(csharp.SourceFile, {
74
74
  path: "Test.cs",
75
75
  get children() {
76
- return [_$createComponent(csharp.EnumDeclaration, {
76
+ return [_$createComponent(csharp.Enum, {
77
77
  "public": true,
78
78
  name: "TestEnum",
79
79
  refkey: enumRK,
@@ -116,7 +116,7 @@ it("can reference things by refkey across files", () => {
116
116
  return [_$createComponent(csharp.SourceFile, {
117
117
  path: "Test.cs",
118
118
  get children() {
119
- return [_$createComponent(csharp.EnumDeclaration, {
119
+ return [_$createComponent(csharp.Enum, {
120
120
  "public": true,
121
121
  name: "TestEnum",
122
122
  get children() {
@@ -131,7 +131,7 @@ it("can reference things by refkey across files", () => {
131
131
  }), _$createComponent(csharp.SourceFile, {
132
132
  path: "Other.cs",
133
133
  get children() {
134
- return [_$createComponent(csharp.EnumDeclaration, {
134
+ return [_$createComponent(csharp.Enum, {
135
135
  "public": true,
136
136
  name: "OtherEnum",
137
137
  refkey: enumRK,
@@ -12,7 +12,7 @@ it("defines multiple namespaces and source files with unique content", () => {
12
12
  return [_$createComponent(csharp.SourceFile, {
13
13
  path: "Model1.cs",
14
14
  get children() {
15
- return _$createComponent(csharp.ClassDeclaration, {
15
+ return _$createComponent(csharp.Class, {
16
16
  "public": true,
17
17
  name: "Model1"
18
18
  });
@@ -20,7 +20,7 @@ it("defines multiple namespaces and source files with unique content", () => {
20
20
  }), _$createComponent(csharp.SourceFile, {
21
21
  path: "Model2.cs",
22
22
  get children() {
23
- return _$createComponent(csharp.ClassDeclaration, {
23
+ return _$createComponent(csharp.Class, {
24
24
  "public": true,
25
25
  name: "Model2"
26
26
  });
@@ -33,7 +33,7 @@ it("defines multiple namespaces and source files with unique content", () => {
33
33
  return [_$createComponent(csharp.SourceFile, {
34
34
  path: "Model3.cs",
35
35
  get children() {
36
- return _$createComponent(csharp.ClassDeclaration, {
36
+ return _$createComponent(csharp.Class, {
37
37
  "public": true,
38
38
  name: "Model3"
39
39
  });
@@ -41,7 +41,7 @@ it("defines multiple namespaces and source files with unique content", () => {
41
41
  }), _$createComponent(csharp.SourceFile, {
42
42
  path: "Model4.cs",
43
43
  get children() {
44
- return _$createComponent(csharp.ClassDeclaration, {
44
+ return _$createComponent(csharp.Class, {
45
45
  "public": true,
46
46
  name: "Model4"
47
47
  });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=projectdirectory.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projectdirectory.test.d.ts","sourceRoot":"","sources":["../../test/projectdirectory.test.tsx"],"names":[],"mappings":""}
@@ -18,7 +18,7 @@ it("defines a project directory file with multiple source files", () => {
18
18
  return [_$createComponent(csharp.SourceFile, {
19
19
  path: "Test1.cs",
20
20
  get children() {
21
- return _$createComponent(csharp.ClassDeclaration, {
21
+ return _$createComponent(csharp.Class, {
22
22
  "public": true,
23
23
  name: "TestClass1"
24
24
  });
@@ -26,7 +26,7 @@ it("defines a project directory file with multiple source files", () => {
26
26
  }), _$createComponent(csharp.SourceFile, {
27
27
  path: "Test2.cs",
28
28
  get children() {
29
- return _$createComponent(csharp.ClassDeclaration, {
29
+ return _$createComponent(csharp.Class, {
30
30
  "public": true,
31
31
  name: "TestClass2"
32
32
  });
@@ -82,7 +82,7 @@ it("defines a project directory file with multiple source files and a custom TFM
82
82
  return [_$createComponent(csharp.SourceFile, {
83
83
  path: "Test1.cs",
84
84
  get children() {
85
- return _$createComponent(csharp.ClassDeclaration, {
85
+ return _$createComponent(csharp.Class, {
86
86
  "public": true,
87
87
  name: "TestClass1"
88
88
  });
@@ -90,7 +90,7 @@ it("defines a project directory file with multiple source files and a custom TFM
90
90
  }), _$createComponent(csharp.SourceFile, {
91
91
  path: "Test2.cs",
92
92
  get children() {
93
- return _$createComponent(csharp.ClassDeclaration, {
93
+ return _$createComponent(csharp.Class, {
94
94
  "public": true,
95
95
  name: "TestClass2"
96
96
  });
@@ -12,7 +12,7 @@ it("defines multiple source files with unique content", () => {
12
12
  return [_$createComponent(csharp.SourceFile, {
13
13
  path: "Test1.cs",
14
14
  get children() {
15
- return _$createComponent(csharp.ClassDeclaration, {
15
+ return _$createComponent(csharp.Class, {
16
16
  "public": true,
17
17
  name: "TestClass1"
18
18
  });
@@ -20,7 +20,7 @@ it("defines multiple source files with unique content", () => {
20
20
  }), _$createComponent(csharp.SourceFile, {
21
21
  path: "Test2.cs",
22
22
  get children() {
23
- return _$createComponent(csharp.ClassDeclaration, {
23
+ return _$createComponent(csharp.Class, {
24
24
  "public": true,
25
25
  name: "TestClass2"
26
26
  });
@@ -63,15 +63,15 @@ it("adds using statement across namespaces", () => {
63
63
  return _$createComponent(csharp.SourceFile, {
64
64
  path: "Models.cs",
65
65
  get children() {
66
- return [_$createComponent(csharp.ClassDeclaration, {
66
+ return [_$createComponent(csharp.Class, {
67
67
  "public": true,
68
68
  name: "Input",
69
69
  refkey: inputTypeRefkey
70
- }), _$createIntrinsic("hbr", {}), _$createComponent(csharp.ClassDeclaration, {
70
+ }), _$createIntrinsic("hbr", {}), _$createComponent(csharp.Class, {
71
71
  "public": true,
72
72
  name: "Output",
73
73
  refkey: outputTypeRefkey
74
- }), _$createIntrinsic("hbr", {}), _$createComponent(csharp.EnumDeclaration, {
74
+ }), _$createIntrinsic("hbr", {}), _$createComponent(csharp.Enum, {
75
75
  "public": true,
76
76
  name: "TestEnum",
77
77
  get children() {
@@ -93,7 +93,7 @@ it("adds using statement across namespaces", () => {
93
93
  path: "Client.cs",
94
94
  using: ["System"],
95
95
  get children() {
96
- return [_$createComponent(csharp.ClassDeclaration, {
96
+ return [_$createComponent(csharp.Class, {
97
97
  "public": true,
98
98
  name: "Client",
99
99
  get children() {