@@ -44,7 +44,7 @@ public async Task Default_JsonApi_endpoints_are_exposed()
4444 }
4545
4646 [ Fact ]
47- public async Task Upload_endpoint_is_exposed ( )
47+ public async Task Upload_file_endpoint_is_exposed ( )
4848 {
4949 // Act
5050 JsonElement document = await _testContext . GetSwaggerDocumentAsync ( ) ;
@@ -97,7 +97,7 @@ public async Task Upload_endpoint_is_exposed()
9797 }
9898
9999 [ Fact ]
100- public async Task Exists_endpoint_is_exposed ( )
100+ public async Task File_exists_endpoint_is_exposed ( )
101101 {
102102 // Act
103103 JsonElement document = await _testContext . GetSwaggerDocumentAsync ( ) ;
@@ -159,7 +159,7 @@ public async Task Exists_endpoint_is_exposed()
159159 }
160160
161161 [ Fact ]
162- public async Task Download_endpoint_is_exposed ( )
162+ public async Task Download_file_endpoint_is_exposed ( )
163163 {
164164 // Act
165165 JsonElement document = await _testContext . GetSwaggerDocumentAsync ( ) ;
@@ -227,4 +227,139 @@ public async Task Download_endpoint_is_exposed()
227227 }
228228 """ ) ;
229229 }
230+
231+ [ Fact ]
232+ public async Task Send_email_endpoint_is_exposed ( )
233+ {
234+ // Act
235+ JsonElement document = await _testContext . GetSwaggerDocumentAsync ( ) ;
236+
237+ // Assert
238+ document . Should ( ) . ContainPath ( "paths./emails/send.post" ) . Should ( ) . BeJson ( """
239+ {
240+ "tags": [
241+ "emails"
242+ ],
243+ "description": "Sends an email to the specified recipient.",
244+ "operationId": "sendEmail",
245+ "requestBody": {
246+ "content": {
247+ "application/json": {
248+ "schema": {
249+ "allOf": [
250+ {
251+ "$ref": "#/components/schemas/email"
252+ }
253+ ],
254+ "description": "The email to send."
255+ }
256+ }
257+ },
258+ "required": true
259+ },
260+ "responses": {
261+ "200": {
262+ "description": "OK"
263+ },
264+ "400": {
265+ "description": "Bad Request",
266+ "content": {
267+ "application/problem+json": {
268+ "schema": {
269+ "$ref": "#/components/schemas/httpValidationProblemDetails"
270+ }
271+ }
272+ }
273+ }
274+ }
275+ }
276+ """ ) ;
277+ }
278+
279+ [ Fact ]
280+ public async Task Emails_sent_since_endpoint_is_exposed ( )
281+ {
282+ // Act
283+ JsonElement document = await _testContext . GetSwaggerDocumentAsync ( ) ;
284+
285+ // Assert
286+ document . Should ( ) . ContainPath ( "paths./emails/sent-since.get" ) . Should ( ) . BeJson ( """
287+ {
288+ "tags": [
289+ "emails"
290+ ],
291+ "description": "Gets all emails sent since the specified date/time.",
292+ "operationId": "getSentSince",
293+ "parameters": [
294+ {
295+ "name": "sinceUtc",
296+ "in": "query",
297+ "description": "The date/time (in UTC) since which the email was sent.",
298+ "required": true,
299+ "schema": {
300+ "type": "string",
301+ "description": "The date/time (in UTC) since which the email was sent.",
302+ "format": "date-time"
303+ }
304+ }
305+ ],
306+ "responses": {
307+ "200": {
308+ "description": "OK",
309+ "content": {
310+ "application/json": {
311+ "schema": {
312+ "type": "array",
313+ "items": {
314+ "$ref": "#/components/schemas/email"
315+ }
316+ }
317+ }
318+ }
319+ },
320+ "400": {
321+ "description": "Bad Request",
322+ "content": {
323+ "application/problem+json": {
324+ "schema": {
325+ "$ref": "#/components/schemas/httpValidationProblemDetails"
326+ }
327+ }
328+ }
329+ }
330+ }
331+ }
332+ """ ) ;
333+
334+ document . Should ( ) . ContainPath ( "paths./emails/sent-since.head" ) . Should ( ) . BeJson ( """
335+ {
336+ "tags": [
337+ "emails"
338+ ],
339+ "description": "Gets all emails sent since the specified date/time.",
340+ "operationId": "tryGetSentSince",
341+ "parameters": [
342+ {
343+ "name": "sinceUtc",
344+ "in": "query",
345+ "description": "The date/time (in UTC) since which the email was sent.",
346+ "required": true,
347+ "schema": {
348+ "type": "string",
349+ "description": "The date/time (in UTC) since which the email was sent.",
350+ "format": "date-time"
351+ }
352+ }
353+ ],
354+ "responses": {
355+ "200": {
356+ "description": "OK"
357+ },
358+ "400": {
359+ "description": "Bad Request"
360+ }
361+ }
362+ }
363+ """ ) ;
364+ }
230365}
0 commit comments