@studyportals/sp-lurch-interface 2.14.0 → 2.15.0

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 (157) hide show
  1. package/{index.ts → index.d.ts} +2 -24
  2. package/index.js +34 -0
  3. package/index.js.map +1 -0
  4. package/package.json +3 -3
  5. package/src/entities/organisation/i-organisation.interface.d.ts +5 -0
  6. package/src/entities/organisation/i-organisation.interface.js +3 -0
  7. package/src/entities/organisation/i-organisation.interface.js.map +1 -0
  8. package/src/entities/organisation/main-organisations-dto.d.ts +6 -0
  9. package/src/entities/organisation/main-organisations-dto.js +11 -0
  10. package/src/entities/organisation/main-organisations-dto.js.map +1 -0
  11. package/src/entities/organisation/organisation-dto.class.d.ts +7 -0
  12. package/src/entities/organisation/organisation-dto.class.js +12 -0
  13. package/src/entities/organisation/organisation-dto.class.js.map +1 -0
  14. package/src/entities/organisation/organisations-dto.d.ts +6 -0
  15. package/src/entities/organisation/organisations-dto.js +11 -0
  16. package/src/entities/organisation/organisations-dto.js.map +1 -0
  17. package/src/input-batches/input-batch-dto.class.d.ts +15 -0
  18. package/src/input-batches/input-batch-dto.class.js +20 -0
  19. package/src/input-batches/input-batch-dto.class.js.map +1 -0
  20. package/src/input-batches/input-batch-status.d.ts +5 -0
  21. package/src/input-batches/input-batch-status.js +10 -0
  22. package/src/input-batches/input-batch-status.js.map +1 -0
  23. package/src/input-batches/interfaces/i-input-batch.interface.d.ts +13 -0
  24. package/src/input-batches/interfaces/i-input-batch.interface.js +3 -0
  25. package/src/input-batches/interfaces/i-input-batch.interface.js.map +1 -0
  26. package/src/intakes/intake-dto.class.d.ts +14 -0
  27. package/src/intakes/intake-dto.class.js +18 -0
  28. package/src/intakes/intake-dto.class.js.map +1 -0
  29. package/src/intakes/intake-stage-type.d.ts +6 -0
  30. package/src/intakes/intake-stage-type.js +11 -0
  31. package/src/intakes/intake-stage-type.js.map +1 -0
  32. package/src/intakes/interfaces/i-intake.interface.d.ts +12 -0
  33. package/src/intakes/interfaces/i-intake.interface.js +3 -0
  34. package/src/intakes/interfaces/i-intake.interface.js.map +1 -0
  35. package/src/intakes/interfaces/i-match.interface.d.ts +4 -0
  36. package/src/intakes/interfaces/i-match.interface.js +3 -0
  37. package/src/intakes/interfaces/i-match.interface.js.map +1 -0
  38. package/src/intakes/match-dto.class.d.ts +6 -0
  39. package/src/intakes/match-dto.class.js +11 -0
  40. package/src/intakes/match-dto.class.js.map +1 -0
  41. package/src/lurch-client.d.ts +19 -0
  42. package/src/lurch-client.js +77 -0
  43. package/src/lurch-client.js.map +1 -0
  44. package/src/results/discard-input-batch-result.class.d.ts +6 -0
  45. package/src/results/discard-input-batch-result.class.js +17 -0
  46. package/src/results/discard-input-batch-result.class.js.map +1 -0
  47. package/src/results/microsite-student-profile-result.class.d.ts +8 -0
  48. package/src/results/microsite-student-profile-result.class.js +19 -0
  49. package/src/results/microsite-student-profile-result.class.js.map +1 -0
  50. package/src/results/retrieve-input-batch-result.class.d.ts +8 -0
  51. package/src/results/retrieve-input-batch-result.class.js +19 -0
  52. package/src/results/retrieve-input-batch-result.class.js.map +1 -0
  53. package/src/results/retrieve-input-batches-result.class.d.ts +8 -0
  54. package/src/results/retrieve-input-batches-result.class.js +19 -0
  55. package/src/results/retrieve-input-batches-result.class.js.map +1 -0
  56. package/src/results/retrieve-intake-result.class.d.ts +8 -0
  57. package/src/results/retrieve-intake-result.class.js +19 -0
  58. package/src/results/retrieve-intake-result.class.js.map +1 -0
  59. package/src/results/retrieve-intakes-result.class.d.ts +8 -0
  60. package/src/results/retrieve-intakes-result.class.js +19 -0
  61. package/src/results/retrieve-intakes-result.class.js.map +1 -0
  62. package/src/results/retrieve-main-organisations-result.class.d.ts +9 -0
  63. package/src/results/retrieve-main-organisations-result.class.js +21 -0
  64. package/src/results/retrieve-main-organisations-result.class.js.map +1 -0
  65. package/src/results/retrieve-organisations-result.class.d.ts +9 -0
  66. package/src/results/retrieve-organisations-result.class.js +21 -0
  67. package/src/results/retrieve-organisations-result.class.js.map +1 -0
  68. package/src/results/submit-matches-result.class.d.ts +6 -0
  69. package/src/results/submit-matches-result.class.js +17 -0
  70. package/src/results/submit-matches-result.class.js.map +1 -0
  71. package/src/student-profile/interfaces/I-microsite-student-profile.interface.d.ts +9 -0
  72. package/src/student-profile/interfaces/I-microsite-student-profile.interface.js +3 -0
  73. package/src/student-profile/interfaces/I-microsite-student-profile.interface.js.map +1 -0
  74. package/src/student-profile/interfaces/I-student-profile.interface.d.ts +9 -0
  75. package/src/student-profile/interfaces/I-student-profile.interface.js +3 -0
  76. package/src/student-profile/interfaces/I-student-profile.interface.js.map +1 -0
  77. package/tests-u/entities/organisations/organisation-dto.test.d.ts +1 -0
  78. package/tests-u/entities/organisations/organisation-dto.test.js +62 -0
  79. package/tests-u/entities/organisations/organisation-dto.test.js.map +1 -0
  80. package/tests-u/input-batches/input-batch-dto.test.d.ts +1 -0
  81. package/tests-u/input-batches/input-batch-dto.test.js +150 -0
  82. package/tests-u/input-batches/input-batch-dto.test.js.map +1 -0
  83. package/tests-u/input-batches/input-batch-status.test.d.ts +1 -0
  84. package/tests-u/input-batches/input-batch-status.test.js +47 -0
  85. package/tests-u/input-batches/input-batch-status.test.js.map +1 -0
  86. package/tests-u/intakes/intake-dto.test.d.ts +1 -0
  87. package/tests-u/intakes/intake-dto.test.js +128 -0
  88. package/tests-u/intakes/intake-dto.test.js.map +1 -0
  89. package/tests-u/intakes/intake-stage-type.test.d.ts +1 -0
  90. package/tests-u/intakes/intake-stage-type.test.js +56 -0
  91. package/tests-u/intakes/intake-stage-type.test.js.map +1 -0
  92. package/tests-u/intakes/match-dto.test.d.ts +1 -0
  93. package/tests-u/intakes/match-dto.test.js +51 -0
  94. package/tests-u/intakes/match-dto.test.js.map +1 -0
  95. package/tests-u/lurch-client.test.d.ts +1 -0
  96. package/tests-u/lurch-client.test.js +303 -0
  97. package/tests-u/lurch-client.test.js.map +1 -0
  98. package/tests-u/results/discard-input-batch-result.test.d.ts +1 -0
  99. package/tests-u/results/discard-input-batch-result.test.js +40 -0
  100. package/tests-u/results/discard-input-batch-result.test.js.map +1 -0
  101. package/tests-u/results/retrieve-input-batch-result.test.d.ts +1 -0
  102. package/tests-u/results/retrieve-input-batch-result.test.js +51 -0
  103. package/tests-u/results/retrieve-input-batch-result.test.js.map +1 -0
  104. package/tests-u/results/retrieve-input-batches-result.test.d.ts +1 -0
  105. package/tests-u/results/retrieve-input-batches-result.test.js +51 -0
  106. package/tests-u/results/retrieve-input-batches-result.test.js.map +1 -0
  107. package/tests-u/results/retrieve-intake-result.test.d.ts +1 -0
  108. package/tests-u/results/retrieve-intake-result.test.js +51 -0
  109. package/tests-u/results/retrieve-intake-result.test.js.map +1 -0
  110. package/tests-u/results/retrieve-intakes-result.test.d.ts +1 -0
  111. package/tests-u/results/retrieve-intakes-result.test.js +51 -0
  112. package/tests-u/results/retrieve-intakes-result.test.js.map +1 -0
  113. package/tests-u/results/retrieve-main-organisation-result.test.d.ts +1 -0
  114. package/tests-u/results/retrieve-main-organisation-result.test.js +53 -0
  115. package/tests-u/results/retrieve-main-organisation-result.test.js.map +1 -0
  116. package/tests-u/results/retrieve-organisation-result.test.d.ts +1 -0
  117. package/tests-u/results/retrieve-organisation-result.test.js +53 -0
  118. package/tests-u/results/retrieve-organisation-result.test.js.map +1 -0
  119. package/tests-u/results/submit-matches-result.test.d.ts +1 -0
  120. package/tests-u/results/submit-matches-result.test.js +31 -0
  121. package/tests-u/results/submit-matches-result.test.js.map +1 -0
  122. package/src/entities/organisation/i-organisation.interface.ts +0 -5
  123. package/src/entities/organisation/organisation-dto.class.ts +0 -11
  124. package/src/entities/organisation/organisations-dto.ts +0 -9
  125. package/src/input-batches/input-batch-dto.class.ts +0 -19
  126. package/src/input-batches/input-batch-status.ts +0 -5
  127. package/src/input-batches/interfaces/i-input-batch.interface.ts +0 -13
  128. package/src/intakes/intake-dto.class.ts +0 -18
  129. package/src/intakes/intake-stage-type.ts +0 -6
  130. package/src/intakes/interfaces/i-intake.interface.ts +0 -14
  131. package/src/intakes/interfaces/i-match.interface.ts +0 -4
  132. package/src/intakes/match-dto.class.ts +0 -10
  133. package/src/lurch-client.ts +0 -85
  134. package/src/results/discard-input-batch-result.class.ts +0 -21
  135. package/src/results/microsite-student-profile-result.class.ts +0 -25
  136. package/src/results/retrieve-input-batch-result.class.ts +0 -25
  137. package/src/results/retrieve-input-batches-result.class.ts +0 -25
  138. package/src/results/retrieve-intake-result.class.ts +0 -25
  139. package/src/results/retrieve-intakes-result.class.ts +0 -25
  140. package/src/results/retrieve-organisations-result.class.ts +0 -26
  141. package/src/results/submit-matches-result.class.ts +0 -18
  142. package/src/student-profile/interfaces/I-microsite-student-profile.interface.ts +0 -10
  143. package/tests-u/entities/organisations/organisation-dto.test.ts +0 -37
  144. package/tests-u/input-batches/input-batch-dto.test.ts +0 -102
  145. package/tests-u/input-batches/input-batch-status.test.ts +0 -21
  146. package/tests-u/intakes/intake-dto.test.ts +0 -86
  147. package/tests-u/intakes/intake-stage-type.test.ts +0 -26
  148. package/tests-u/intakes/match-dto.test.ts +0 -30
  149. package/tests-u/lurch-client.test.ts +0 -257
  150. package/tests-u/results/discard-input-batch-result.test.ts +0 -22
  151. package/tests-u/results/retrieve-input-batch-result.test.ts +0 -31
  152. package/tests-u/results/retrieve-input-batches-result.test.ts +0 -30
  153. package/tests-u/results/retrieve-intake-result.test.ts +0 -30
  154. package/tests-u/results/retrieve-intakes-result.test.ts +0 -30
  155. package/tests-u/results/retrieve-organisation-result.test.ts +0 -32
  156. package/tests-u/results/submit-matches-result.test.ts +0 -16
  157. package/tsconfig.json +0 -38
@@ -1,257 +0,0 @@
1
- import { assert } from "chai";
2
- import { suite, test } from "mocha-typescript";
3
- import { SuperAgentRequest } from "superagent";
4
- import {
5
- IMock, It,
6
- Mock, Times,
7
- } from "typemoq";
8
-
9
- import { IRequestSender, ISuperAgentRequestFactory } from "@studyportals/mb-platform-http-requests";
10
-
11
- import { LurchClient, RetrieveInputBatchesResult } from "../";
12
- import { OrganisationsDto } from "../src/entities/organisation/organisations-dto";
13
-
14
-
15
- @suite
16
- class LurchClientTest {
17
- private mockedSuperAgentRequestFactory: IMock<ISuperAgentRequestFactory>;
18
- private mockedRequest: IMock<SuperAgentRequest>;
19
- private mockedRequestSender: IMock<IRequestSender>;
20
- private mockedTestInstance: IMock<LurchClient>;
21
-
22
- private get superAgentRequestFactory(): ISuperAgentRequestFactory {
23
- return this.mockedSuperAgentRequestFactory.object;
24
- }
25
- private get request(): SuperAgentRequest {
26
- return this.mockedRequest.object;
27
- }
28
- private get requestSender(): IRequestSender {
29
- return this.mockedRequestSender.object;
30
- }
31
- private get testInstance(): LurchClient {
32
- return this.mockedTestInstance.object;
33
- }
34
-
35
-
36
- public before() {
37
- this.mockedSuperAgentRequestFactory = Mock.ofType<ISuperAgentRequestFactory>();
38
- this.mockedRequest = Mock.ofType<SuperAgentRequest>();
39
- this.mockedRequestSender = Mock.ofType<IRequestSender>();
40
-
41
- const { mockedTestInstance } = this.createTestInstance();
42
- this.mockedTestInstance = mockedTestInstance;
43
-
44
- this.mockedTestInstance.setup(_ => _["createGetRequest"](It.isAny()))
45
- .returns(() => this.request);
46
- this.mockedTestInstance.setup(_ => _["createPostRequest"](It.isAny()))
47
- .returns(() => this.request);
48
- }
49
-
50
-
51
-
52
- @test
53
- public buildUrl__RelativePathConcatenatedToBaseUrl() {
54
- const baseUrl = "SomeBaseUrl";
55
- const relativePath = "SomeRelativePath";
56
- const expectedResult = `${baseUrl}${relativePath}`;
57
-
58
- this.mockedTestInstance.setup(_ => _["baseUrl"]).returns(() => baseUrl);
59
-
60
- const result = this.testInstance["buildUrl"](relativePath);
61
-
62
- assert.equal(result, expectedResult);
63
- }
64
-
65
-
66
-
67
-
68
-
69
- @test
70
- public async retrieveAllInputBatches__GetRequestCreatedForCorrectPath() {
71
- this.mockedRequestSender.setup(_ => _.sendAndExtractBody(It.isAny())).returns(() => ({} as any));
72
-
73
- await this.testInstance.retrieveAllInputBatches();
74
-
75
- this.mockedTestInstance.verify(_ => _["createGetRequest"]("/input-batches"), Times.once());
76
- }
77
-
78
- @test
79
- public async retrieveAllInputBatches__RequestSent() {
80
- this.mockedRequestSender.setup(_ => _.sendAndExtractBody(It.isAny())).returns(() => ({} as any));
81
-
82
- await this.testInstance.retrieveAllInputBatches();
83
-
84
- this.mockedRequestSender.verify(_ => _.sendAndExtractBody(this.request), Times.once());
85
- }
86
-
87
- @test
88
- public async retrieveAllInputBatches__InputBatchesProvided() {
89
- const inputBatches = "SomeInputBatches" as any;
90
- const retrieveInputBatchesResult = new RetrieveInputBatchesResult(inputBatches);
91
-
92
- this.mockedRequestSender.setup(_ => _.sendAndExtractBody(It.isAny())).returns(async () => retrieveInputBatchesResult);
93
-
94
- const result = await this.testInstance.retrieveAllInputBatches();
95
-
96
- assert.equal(result, inputBatches);
97
- }
98
-
99
- @test
100
- public async approveInputBatch__PostRequestCreatedForCorrectPath() {
101
- await this.testInstance.approveInputBatch(It.isAny());
102
-
103
- this.mockedTestInstance.verify(_ => _["createPostRequest"]("/input-batch/approve"), Times.once());
104
- }
105
-
106
- @test
107
- public async approveInputBatch__InputBatchIdentitySpecified() {
108
- const inputBatchIdentity = "InputBatchIdentity" as any;
109
-
110
- await this.testInstance.approveInputBatch(inputBatchIdentity);
111
-
112
- this.mockedRequest.verify(_ => _.send(It.isObjectWith({ inputBatchIdentity: inputBatchIdentity })), Times.once());
113
- }
114
-
115
- @test
116
- public async approveInputBatch__RequestSent() {
117
- let awaited = false;
118
-
119
- this.mockedRequestSender.setup(_ => _.send(It.isAny()))
120
- .returns(() => new Promise(_ => setImmediate(() => { awaited=true; _(); })));;
121
-
122
- await this.testInstance.approveInputBatch(It.isAny());
123
-
124
- this.mockedRequestSender.verify(_ => _.send(this.request), Times.once());
125
- assert.isTrue(awaited);
126
- }
127
-
128
- @test
129
- public async discardInputBatch__PostRequestCreatedForCorrectPath() {
130
- await this.testInstance.discardInputBatch(It.isAny());
131
-
132
- this.mockedTestInstance.verify(_ => _["createPostRequest"]("/input-batch/discard"), Times.once());
133
- }
134
-
135
- @test
136
- public async discardInputBatch__InputBatchIdentitySpecified() {
137
- const inputBatchIdentity = "InputBatchIdentity" as any;
138
-
139
- await this.testInstance.discardInputBatch(inputBatchIdentity);
140
-
141
- this.mockedRequest.verify(_ => _.send(It.isObjectWith({ inputBatchIdentity: inputBatchIdentity })), Times.once());
142
- }
143
-
144
- @test
145
- public async discardInputBatch__RequestSent() {
146
- let awaited = false;
147
-
148
- this.mockedRequestSender.setup(_ => _.send(It.isAny()))
149
- .returns(() => new Promise(_ => setImmediate(() => { awaited = true; _(); })));;
150
-
151
- await this.testInstance.discardInputBatch(It.isAny());
152
-
153
- this.mockedRequestSender.verify(_ => _.send(this.request), Times.once());
154
- assert.isTrue(awaited);
155
- }
156
-
157
- @test
158
- public createGetRequest__UrlCorrectlyBuilt() {
159
- const {mockedTestInstance, testInstance} = this.createTestInstance();
160
-
161
- const relativePath = "SomeRelativePath";
162
- const url = "SomeUrl";
163
-
164
- mockedTestInstance.setup(_ => _["buildUrl"](It.isAny())).returns(() => url);
165
-
166
- testInstance["createGetRequest"](relativePath);
167
-
168
- mockedTestInstance.verify(_ => _["buildUrl"](relativePath), Times.once());
169
- }
170
-
171
- @test
172
- public createGetRequest__GetRequestCreatedAndProvided() {
173
- const {mockedTestInstance, testInstance} = this.createTestInstance();
174
- const url = "SomeUrl";
175
- const request = "SomeRequest" as any;
176
-
177
- this.mockedSuperAgentRequestFactory.setup(_ => _.get(It.isAny())).returns(() => request);
178
- mockedTestInstance.setup(_ => _["buildUrl"](It.isAny())).returns(() => url);
179
-
180
- const result = testInstance["createGetRequest"]("");
181
-
182
- assert.equal(result, request);
183
- this.mockedSuperAgentRequestFactory.verify(_ => _.get(url), Times.once());
184
- }
185
-
186
- @test
187
- public createPostRequest__UrlCorrectlyBuilt() {
188
- const {mockedTestInstance, testInstance} = this.createTestInstance();
189
-
190
- const relativePath = "SomeRelativePath";
191
- const url = "SomeUrl";
192
-
193
- mockedTestInstance.setup(_ => _["buildUrl"](It.isAny())).returns(() => url);
194
-
195
- testInstance["createPostRequest"](relativePath);
196
-
197
- mockedTestInstance.verify(_ => _["buildUrl"](relativePath), Times.once());
198
- }
199
-
200
- @test
201
- public createPostRequest__PostRequestCreatedAndProvided() {
202
- const {mockedTestInstance, testInstance} = this.createTestInstance();
203
- const url = "SomeUrl";
204
- const request = "SomeRequest" as any;
205
-
206
- this.mockedSuperAgentRequestFactory.setup(_ => _.post(It.isAny())).returns(() => request);
207
- mockedTestInstance.setup(_ => _["buildUrl"](It.isAny())).returns(() => url);
208
-
209
- const result = testInstance["createPostRequest"]("");
210
-
211
- assert.equal(result, request);
212
- this.mockedSuperAgentRequestFactory.verify(_ => _.post(url), Times.once());
213
- }
214
-
215
- @test
216
- public async retrieveOrganisationsFromUser__GetRequestCreatedForCorrectPath() {
217
- this.mockedRequestSender.setup(_ => _.sendAndExtractBody(It.isAny())).returns(() => ({} as any));
218
-
219
- await this.testInstance.retrieveOrganisationsFromUser();
220
-
221
- this.mockedTestInstance.verify(_ => _["createGetRequest"]("/organisations-for-user"), Times.once());
222
- }
223
-
224
- @test
225
- public async retrieveOrganisationsFromUser__RequestSent() {
226
- this.mockedRequestSender.setup(_ => _.sendAndExtractBody(It.isAny())).returns(() => ({} as any));
227
-
228
- await this.testInstance.retrieveOrganisationsFromUser();
229
-
230
- this.mockedRequestSender.verify(_ => _.sendAndExtractBody(this.request), Times.once());
231
- }
232
-
233
- @test
234
- public async retrieveOrganisationsFromUser__InputBatchesProvided() {
235
- const userId = "someUserId" as any;
236
- const organisations = "SomeOrganisations" as any;
237
- const organisationDto = new OrganisationsDto(userId, organisations);
238
-
239
- this.mockedRequestSender.setup(_ => _.sendAndExtractBody(It.isAny())).returns(async () => organisationDto);
240
-
241
- const result = await this.testInstance.retrieveOrganisationsFromUser();
242
-
243
- assert.deepEqual(result, organisationDto);
244
- }
245
-
246
-
247
- private createTestInstance() {
248
- const mockedTestInstance = Mock.ofType(LurchClient);
249
- const testInstance = mockedTestInstance.object;
250
-
251
- mockedTestInstance.callBase = true;
252
- mockedTestInstance.setup(_ => _["superAgentRequestFactory"]).returns(() => this.superAgentRequestFactory);
253
- mockedTestInstance.setup(_ => _["requestSender"]).returns(() => this.requestSender);
254
-
255
- return { mockedTestInstance, testInstance };
256
- }
257
- }
@@ -1,22 +0,0 @@
1
- import { assert } from "chai";
2
- import { suite, test } from "mocha-typescript";
3
-
4
- import { DiscardInputBatchresult } from "../..";
5
-
6
-
7
- @suite
8
- class DiscardInputBatchResultTest {
9
- @test
10
- public constructor__TypeGuardInitialized() {
11
- const testInstance = new DiscardInputBatchresult();
12
-
13
- assert.isTrue(testInstance.__discard_input_batch_result__);
14
- }
15
-
16
- @test
17
- public serialization__TypeGuardSerialized() {
18
- const deserialization = JSON.parse(JSON.stringify(new DiscardInputBatchresult()));
19
-
20
- assert.isTrue(deserialization.__discard_input_batch_result__);
21
- }
22
- }
@@ -1,31 +0,0 @@
1
- import { assert } from "chai";
2
- import { suite, test } from "mocha-typescript";
3
-
4
- import { RetrieveInputBatchResult } from "../../src/results/retrieve-input-batch-result.class";
5
- import { RetrieveIntakeResult } from "../../src/results/retrieve-intake-result.class";
6
-
7
-
8
- @suite
9
- class RetrieveInputBatchResultTest {
10
- @test
11
- public constructor__TypeGuardInitialized() {
12
- const testInstance = new RetrieveInputBatchResult(null as any);
13
-
14
- assert.isTrue(testInstance.__retrieve_input_batch_result__);
15
- }
16
-
17
- @test
18
- public serialization__TypeGuardSerialized() {
19
- const deserialization = JSON.parse(JSON.stringify(new RetrieveInputBatchResult(null as any)));
20
-
21
- assert.isTrue(deserialization.__retrieve_input_batch_result__);
22
- }
23
-
24
- @test
25
- public serialization__InputBatchSerialized() {
26
- const value = "SomeValue" as any;
27
- const deserialization = JSON.parse(JSON.stringify(new RetrieveInputBatchResult(value)));
28
-
29
- assert.equal(deserialization.inputBatch, value);
30
- }
31
- }
@@ -1,30 +0,0 @@
1
- import { assert } from "chai";
2
- import { suite, test } from "mocha-typescript";
3
-
4
- import { RetrieveInputBatchesResult } from "../../src/results/retrieve-input-batches-result.class";
5
-
6
-
7
- @suite
8
- class RetrieveInputBatchesResultTest {
9
- @test
10
- public constructor__TypeGuardInitialized() {
11
- const testInstance = new RetrieveInputBatchesResult([]);
12
-
13
- assert.isTrue(testInstance.__retrieve_input_batches_result__);
14
- }
15
-
16
- @test
17
- public serialization__TypeGuardSerialized() {
18
- const deserialization = JSON.parse(JSON.stringify(new RetrieveInputBatchesResult([])));
19
-
20
- assert.isTrue(deserialization.__retrieve_input_batches_result__);
21
- }
22
-
23
- @test
24
- public serialization__InputBatchesSerialized() {
25
- const value = "SomeValue" as any;
26
- const deserialization = JSON.parse(JSON.stringify(new RetrieveInputBatchesResult(value)));
27
-
28
- assert.equal(deserialization.inputBatches, value);
29
- }
30
- }
@@ -1,30 +0,0 @@
1
- import { assert } from "chai";
2
- import { suite, test } from "mocha-typescript";
3
-
4
- import { RetrieveIntakeResult } from "../../src/results/retrieve-intake-result.class";
5
-
6
-
7
- @suite
8
- class RetrieveIntakeResultTest {
9
- @test
10
- public constructor__TypeGuardInitialized() {
11
- const testInstance = new RetrieveIntakeResult(null as any);
12
-
13
- assert.isTrue(testInstance.__retrieve_intake_result__);
14
- }
15
-
16
- @test
17
- public serialization__TypeGuardSerialized() {
18
- const deserialization = JSON.parse(JSON.stringify(new RetrieveIntakeResult(null as any)));
19
-
20
- assert.isTrue(deserialization.__retrieve_intake_result__);
21
- }
22
-
23
- @test
24
- public serialization__IntakeSerialized() {
25
- const value = "SomeValue" as any;
26
- const deserialization = JSON.parse(JSON.stringify(new RetrieveIntakeResult(value)));
27
-
28
- assert.equal(deserialization.intake, value);
29
- }
30
- }
@@ -1,30 +0,0 @@
1
- import { assert } from "chai";
2
- import { suite, test } from "mocha-typescript";
3
-
4
- import { RetrieveIntakesResult } from "../../src/results/retrieve-intakes-result.class";
5
-
6
-
7
- @suite
8
- class RetrieveIntakesResultTest {
9
- @test
10
- public constructor__TypeGuardInitialized() {
11
- const testInstance = new RetrieveIntakesResult([]);
12
-
13
- assert.isTrue(testInstance.__retrieve_intakes_result__);
14
- }
15
-
16
- @test
17
- public serialization__TypeGuardSerialized() {
18
- const deserialization = JSON.parse(JSON.stringify(new RetrieveIntakesResult([])));
19
-
20
- assert.isTrue(deserialization.__retrieve_intakes_result__);
21
- }
22
-
23
- @test
24
- public serialization__IntakesSerialized() {
25
- const value = "SomeValue" as any;
26
- const deserialization = JSON.parse(JSON.stringify(new RetrieveIntakesResult(value)));
27
-
28
- assert.equal(deserialization.intakes, value);
29
- }
30
- }
@@ -1,32 +0,0 @@
1
- import { assert } from "chai";
2
- import { suite, test } from "mocha-typescript";
3
-
4
- import { RetrieveOrganisationsResult } from "../../src/results/retrieve-organisations-result.class";
5
-
6
-
7
- @suite
8
- class RetrieveOrganisationsResultTest {
9
- @test
10
- public constructor__TypeGuardInitialized() {
11
- const testInstance = new RetrieveOrganisationsResult([], 0);
12
-
13
- assert.isTrue(testInstance.__retrieve_organisation_result__);
14
- }
15
-
16
- @test
17
- public serialization__TypeGuardSerialized() {
18
- const deserialization = JSON.parse(JSON.stringify(new RetrieveOrganisationsResult([], 0)));
19
-
20
- assert.isTrue(deserialization.__retrieve_organisation_result__);
21
- }
22
-
23
- @test
24
- public serialization__OrganisationsSerialized() {
25
- const value = "SomeValue" as any;
26
- const userId = 1;
27
- const deserialization = JSON.parse(JSON.stringify(new RetrieveOrganisationsResult(value, userId)));
28
-
29
- assert.equal(deserialization.organisations, value);
30
- assert.equal(deserialization.userId, userId);
31
- }
32
- }
@@ -1,16 +0,0 @@
1
- import { assert } from "chai";
2
- import { suite, test } from "mocha-typescript";
3
-
4
- import { SubmitMatchesResult } from "../../src/results/submit-matches-result.class";
5
-
6
-
7
- @suite
8
- class SubmitMatchesResultTest {
9
- @test
10
- public serialization__ConfirmedMatchesCountSerialized() {
11
- const value = "SomeValue" as any;
12
- const deserialization = JSON.parse(JSON.stringify(new SubmitMatchesResult(value)));
13
-
14
- assert.equal(deserialization.confirmedMatchesCount, value);
15
- }
16
- }
package/tsconfig.json DELETED
@@ -1,38 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "outDir": "bin",
4
- "rootDir": ".",
5
- "declaration": true,
6
- "moduleResolution": "node",
7
-
8
- "alwaysStrict": true,
9
- "strictNullChecks": true,
10
-
11
- "allowJs": false,
12
- "allowUnreachableCode": false,
13
- "allowUnusedLabels": false,
14
-
15
- "noUnusedLocals": false,
16
- "noUnusedParameters": false,
17
-
18
- "noFallthroughCasesInSwitch": true,
19
- "noImplicitAny": true,
20
- "noImplicitReturns": true,
21
- "noImplicitThis": true,
22
-
23
- "sourceMap": true,
24
-
25
- "target": "es6",
26
- "lib": ["es6", "dom"],
27
- "module": "commonjs",
28
-
29
- "experimentalDecorators": true,
30
- "emitDecoratorMetadata": true,
31
-
32
- "types": []
33
- },
34
-
35
- "typeRoots": [ "node_modules/@types/" ],
36
-
37
- "exclude": [ "node_modules", "bin" ]
38
- }