Skip to content

Commit 648cd21

Browse files
committed
Fix Recording API Tests
1 parent 2921b50 commit 648cd21

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

src/Bandwidth.Standard.Test/Api/RecordingsApiTests.cs

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -61,28 +61,28 @@ public void InstanceTest()
6161
}
6262

6363
/// <summary>
64-
/// Test DeleteCallTranscription
64+
/// Test DeleteRecordingTranscription
6565
/// </summary>
6666
[Fact]
67-
public void DeleteCallTranscriptionTest()
67+
public void DeleteRecordingTranscriptionTest()
6868
{
6969
string accountId = "9900000";
7070
string callId = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85";
7171
string recordingId = "r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85";
7272

7373
var apiResponse = new ApiResponse<Object>(HttpStatusCode.NoContent, null);
7474
mockClient.Setup(x => x.Delete<Object>("/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription", It.IsAny<RequestOptions>(), fakeConfiguration)).Returns(apiResponse);
75-
var response = instance.DeleteCallTranscriptionWithHttpInfo(accountId, callId, recordingId);
75+
var response = instance.DeleteRecordingTranscriptionWithHttpInfo(accountId, callId, recordingId);
7676

7777
Assert.IsType<ApiResponse<Object>>(response);
7878
Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
7979
}
8080

8181
/// <summary>
82-
/// Test Unauthorized DeleteCallTranscription
82+
/// Test Unauthorized DeleteRecordingTranscription
8383
/// </summary>
8484
[Fact]
85-
public void DeleteCallTranscriptionUnauthorizedRequest()
85+
public void DeleteRecordingTranscriptionUnauthorizedRequest()
8686
{
8787
string accountId = "9900000";
8888
string callId = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85";
@@ -92,17 +92,17 @@ public void DeleteCallTranscriptionUnauthorizedRequest()
9292

9393
var apiResponse = new ApiResponse<Object>(HttpStatusCode.Unauthorized, null);
9494
mockClient.Setup(x => x.Delete<Object>("/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription", It.IsAny<RequestOptions>(), fakeConfiguration)).Returns(apiResponse);
95-
ApiException Exception = Assert.Throws<ApiException>(() => instance.DeleteCallTranscriptionWithHttpInfo(accountId, callId, recordingId));
95+
ApiException Exception = Assert.Throws<ApiException>(() => instance.DeleteRecordingTranscriptionWithHttpInfo(accountId, callId, recordingId));
9696

97-
Assert.Equal("Error calling DeleteCallTranscription: ", Exception.Message);
97+
Assert.Equal("Error calling DeleteRecordingTranscription: ", Exception.Message);
9898
Assert.Equal(401, Exception.ErrorCode);
9999
}
100100

101101
/// <summary>
102-
/// Test Forbidden DeleteCallTranscription
102+
/// Test Forbidden DeleteRecordingTranscription
103103
/// </summary>
104104
[Fact]
105-
public void DeleteCallTranscriptionForbiddenRequest()
105+
public void DeleteRecordingTranscriptionForbiddenRequest()
106106
{
107107
string accountId = "9900000";
108108
string callId = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85";
@@ -112,9 +112,9 @@ public void DeleteCallTranscriptionForbiddenRequest()
112112

113113
var apiResponse = new ApiResponse<Object>(HttpStatusCode.Forbidden, null);
114114
mockClient.Setup(x => x.Delete<Object>("/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription", It.IsAny<RequestOptions>(), fakeConfiguration)).Returns(apiResponse);
115-
ApiException Exception = Assert.Throws<ApiException>(() => instance.DeleteCallTranscriptionWithHttpInfo(accountId, callId, recordingId));
115+
ApiException Exception = Assert.Throws<ApiException>(() => instance.DeleteRecordingTranscriptionWithHttpInfo(accountId, callId, recordingId));
116116

117-
Assert.Equal("Error calling DeleteCallTranscription: ", Exception.Message);
117+
Assert.Equal("Error calling DeleteRecordingTranscription: ", Exception.Message);
118118
Assert.Equal(403, Exception.ErrorCode);
119119
}
120120

@@ -150,12 +150,12 @@ public void DeleteRecordingUnauthorizedRequest()
150150

151151
var apiResponse = new ApiResponse<Object>(HttpStatusCode.Unauthorized, null);
152152
mockClient.Setup(x => x.Delete<Object>("/accounts/{accountId}/calls/{callId}/recordings/{recordingId}", It.IsAny<RequestOptions>(), fakeConfiguration)).Returns(apiResponse);
153-
153+
154154
ApiException Exception = Assert.Throws<ApiException>(() => instance.DeleteRecordingWithHttpInfo(accountId, callId, recordingId));
155-
155+
156156
Assert.Equal("Error calling DeleteRecording: ", Exception.Message);
157157
Assert.Equal(401, Exception.ErrorCode);
158-
}
158+
}
159159

160160
/// <summary>
161161
/// Test forbidden DeleteRecording
@@ -172,10 +172,10 @@ public void DeleteRecordingForbiddenRequest()
172172
var apiResponse = new ApiResponse<Object>(HttpStatusCode.Forbidden, null);
173173
mockClient.Setup(x => x.Delete<Object>("/accounts/{accountId}/calls/{callId}/recordings/{recordingId}", It.IsAny<RequestOptions>(), fakeConfiguration)).Returns(apiResponse);
174174
ApiException Exception = Assert.Throws<ApiException>(() => instance.DeleteRecordingWithHttpInfo(accountId, callId, recordingId));
175-
175+
176176
Assert.Equal("Error calling DeleteRecording: ", Exception.Message);
177177
Assert.Equal(403, Exception.ErrorCode);
178-
}
178+
}
179179

180180
/// <summary>
181181
/// Test DeleteRecordingMedia
@@ -210,14 +210,14 @@ public void DeleteRecordingMediaUnauthorizedRequest()
210210
var apiResponse = new ApiResponse<Object>(HttpStatusCode.Unauthorized, null);
211211
mockClient.Setup(x => x.Delete<Object>("/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media", It.IsAny<RequestOptions>(), fakeConfiguration)).Returns(apiResponse);
212212
ApiException Exception = Assert.Throws<ApiException>(() => instance.DeleteRecordingMediaWithHttpInfo(accountId, callId, recordingId));
213-
213+
214214
Assert.Equal("Error calling DeleteRecordingMedia: ", Exception.Message);
215215
Assert.Equal(401, Exception.ErrorCode);
216216
}
217217

218218
/// <summary>
219219
/// Test forbidden DeleteRecordingMedia
220-
/// </summary>
220+
/// </summary>
221221
[Fact]
222222
public void DeleteRecordingMediaForbiddenRequest()
223223
{
@@ -230,7 +230,7 @@ public void DeleteRecordingMediaForbiddenRequest()
230230
var apiResponse = new ApiResponse<Object>(HttpStatusCode.Forbidden, null);
231231
mockClient.Setup(x => x.Delete<Object>("/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media", It.IsAny<RequestOptions>(), fakeConfiguration)).Returns(apiResponse);
232232
ApiException Exception = Assert.Throws<ApiException>(() => instance.DeleteRecordingMediaWithHttpInfo(accountId, callId, recordingId));
233-
233+
234234
Assert.Equal("Error calling DeleteRecordingMedia: ", Exception.Message);
235235
Assert.Equal(403, Exception.ErrorCode);
236236
}
@@ -273,7 +273,7 @@ public void DownloadCallRecordingUnauthorizedRequest()
273273
var apiResponse = new ApiResponse<System.IO.Stream>(HttpStatusCode.Unauthorized, null);
274274
mockClient.Setup(x => x.Get<System.IO.Stream>("/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media", It.IsAny<RequestOptions>(), fakeConfiguration)).Returns(apiResponse);
275275
ApiException Exception = Assert.Throws<ApiException>(() => instance.DownloadCallRecordingWithHttpInfo(accountId, callId, recordingId));
276-
276+
277277
Assert.Equal("Error calling DownloadCallRecording: ", Exception.Message);
278278
Assert.Equal(401, Exception.ErrorCode);
279279
}
@@ -294,7 +294,7 @@ public void DownloadCallRecordingForbiddenRequest()
294294
var apiResponse = new ApiResponse<System.IO.Stream>(HttpStatusCode.Forbidden, null);
295295
mockClient.Setup(x => x.Get<System.IO.Stream>("/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media", It.IsAny<RequestOptions>(), fakeConfiguration)).Returns(apiResponse);
296296
ApiException Exception = Assert.Throws<ApiException>(() => instance.DownloadCallRecordingWithHttpInfo(accountId, callId, recordingId));
297-
297+
298298
Assert.Equal("Error calling DownloadCallRecording: ", Exception.Message);
299299
Assert.Equal(403, Exception.ErrorCode);
300300
}
@@ -326,7 +326,7 @@ public void GetCallRecordingTest()
326326
fileFormat: FileFormatEnum.Wav,
327327
status: "completed",
328328
mediaUrl: "https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media",
329-
transcription: new TranscriptionMetadata(
329+
transcription: new RecordingTranscriptionMetadata(
330330
id: "t-387bd648-18f3-4823-9d16-746bca0003c9",
331331
status: "completed",
332332
completedTime: "2022-06-13T18:46:29.715Z",
@@ -355,10 +355,10 @@ public void GetCallRecordingNotFound()
355355
var apiResponse = new ApiResponse<CallRecordingMetadata>(HttpStatusCode.NotFound, null);
356356
mockClient.Setup(x => x.Get<CallRecordingMetadata>("/accounts/{accountId}/calls/{callId}/recordings/{recordingId}", It.IsAny<RequestOptions>(), fakeConfiguration)).Returns(apiResponse);
357357
ApiException Exception = Assert.Throws<ApiException>(() => instance.GetCallRecordingWithHttpInfo(accountId, callId, recordingId));
358-
358+
359359
Assert.Equal("Error calling GetCallRecording: ", Exception.Message);
360360
Assert.Equal(404, Exception.ErrorCode);
361-
}
361+
}
362362

363363
/// <summary>
364364
/// Test Unauthorized GetCallRecording
@@ -375,7 +375,7 @@ public void GetCallRecordingUnauthorizedRequestTest()
375375
var apiResponse = new ApiResponse<CallRecordingMetadata>(HttpStatusCode.Unauthorized, null);
376376
mockClient.Setup(x => x.Get<CallRecordingMetadata>("/accounts/{accountId}/calls/{callId}/recordings/{recordingId}", It.IsAny<RequestOptions>(), fakeConfiguration)).Returns(apiResponse);
377377
ApiException Exception = Assert.Throws<ApiException>(() => instance.GetCallRecordingWithHttpInfo(accountId, callId, recordingId));
378-
378+
379379
Assert.Equal("Error calling GetCallRecording: ", Exception.Message);
380380
Assert.Equal(401, Exception.ErrorCode);
381381
}
@@ -395,26 +395,26 @@ public void GetCallRecordingForbiddenRequest()
395395
var apiResponse = new ApiResponse<CallRecordingMetadata>(HttpStatusCode.Forbidden, null);
396396
mockClient.Setup(x => x.Get<CallRecordingMetadata>("/accounts/{accountId}/calls/{callId}/recordings/{recordingId}", It.IsAny<RequestOptions>(), fakeConfiguration)).Returns(apiResponse);
397397
ApiException Exception = Assert.Throws<ApiException>(() => instance.GetCallRecordingWithHttpInfo(accountId, callId, recordingId));
398-
398+
399399
Assert.Equal("Error calling GetCallRecording: ", Exception.Message);
400400
Assert.Equal(403, Exception.ErrorCode);
401401
}
402402

403403
/// <summary>
404-
/// Test GetCallTranscription
404+
/// Test GetRecordingTranscription
405405
/// </summary>
406406
[Fact]
407-
public void GetCallTranscriptionTest()
407+
public void GetRecordingTranscriptionTest()
408408
{
409409
string accountId = "9900000";
410410
string callId = "c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85";
411411
string recordingId = "r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85";
412412
Transcription transcription = new Transcription(text: "Nice talking to you, friend!", confidence: .9);
413-
TranscriptionList transcriptionList = new TranscriptionList(transcripts: new List<Transcription> { transcription } );
413+
TranscriptionList transcriptionList = new TranscriptionList(transcripts: new List<Transcription> { transcription });
414414

415415
var apiResponse = new ApiResponse<TranscriptionList>(HttpStatusCode.OK, transcriptionList);
416416
mockClient.Setup(x => x.Get<TranscriptionList>("/accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription", It.IsAny<RequestOptions>(), fakeConfiguration)).Returns(apiResponse);
417-
var response = instance.GetCallTranscriptionWithHttpInfo(accountId, callId, recordingId);
417+
var response = instance.GetRecordingTranscriptionWithHttpInfo(accountId, callId, recordingId);
418418

419419
Assert.IsType<ApiResponse<TranscriptionList>>(response);
420420
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
@@ -445,11 +445,11 @@ public void ListAccountCallRecordingsTest()
445445
fileFormat: FileFormatEnum.Wav,
446446
status: "completed",
447447
mediaUrl: "https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media",
448-
transcription: new TranscriptionMetadata(
448+
transcription: new RecordingTranscriptionMetadata(
449449
id: "t-387bd648-18f3-4823-9d16-746bca0003c9",
450450
status: "completed",
451451
completedTime: "2022-06-13T18:46:29.715Z",
452-
url:"https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/recordings/r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/transcription"
452+
url: "https://voice.bandwidth.com/api/v2/accounts/9900000/calls/c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/recordings/r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85/transcription"
453453
)
454454
);
455455

@@ -459,7 +459,7 @@ public void ListAccountCallRecordingsTest()
459459
accountId: accountId,
460460
to: "+19195551234",
461461
from: "+19195554321",
462-
minStartTime: "2022-06-21T19:13:21Z",
462+
minStartTime: "2022-06-21T19:13:21Z",
463463
maxStartTime: "2022-06-21T19:13:21Z"
464464
);
465465

@@ -483,7 +483,7 @@ public void ListAccountCallRecordingsUnauthorizedRequestTest()
483483
accountId: accountId,
484484
to: "+19195551234",
485485
from: "+19195554321",
486-
minStartTime: "2022-06-21T19:13:21Z",
486+
minStartTime: "2022-06-21T19:13:21Z",
487487
maxStartTime: "2022-06-21T19:13:21Z"
488488
));
489489

@@ -505,7 +505,7 @@ public void ListAccountCallRecordingsForbiddenRequestTest()
505505
accountId: accountId,
506506
to: "+19195551234",
507507
from: "+19195554321",
508-
minStartTime: "2022-06-21T19:13:21Z",
508+
minStartTime: "2022-06-21T19:13:21Z",
509509
maxStartTime: "2022-06-21T19:13:21Z"
510510
));
511511

@@ -540,7 +540,7 @@ public void ListCallRecordingsTest()
540540
fileFormat: FileFormatEnum.Wav,
541541
status: "completed",
542542
mediaUrl: "https://voice.bandwidth.com/api/v2/accounts/9900000/conferences/conf-fe23a767-a75a5b77-20c5-4cca-b581-cbbf0776eca9/recordings/r-fbe05094-9fd2afe9-bf5b-4c68-820a-41a01c1c5833/media",
543-
transcription: new TranscriptionMetadata(
543+
transcription: new RecordingTranscriptionMetadata(
544544
id: "t-387bd648-18f3-4823-9d16-746bca0003c9",
545545
status: "completed",
546546
completedTime: "2022-06-13T18:46:29.715Z",

0 commit comments

Comments
 (0)