Skip to content

Commit 270f7f1

Browse files
committed
Fix Recordings Integration Tests
1 parent 648cd21 commit 270f7f1

File tree

1 file changed

+37
-37
lines changed

1 file changed

+37
-37
lines changed

src/Bandwidth.Standard.Test/Integration/RecordingsIntegrationTests.cs

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public RecordingsIntegrationTests()
6868
fakeConfiguration.Password = BW_FORBIDDEN_PASSWORD;
6969
forbiddenInstance = new RecordingsApi(fakeConfiguration);
7070

71-
restClient = new ApiClient(basePath: "https://voice.bandwidth.com/api/v2");
71+
restClient = new ApiClient(basePath: "https://voice.bandwidth.com/api/v2");
7272

7373
mantecaCallBody = new CreateCall(
7474
to: MANTECA_IDLE_NUMBER,
@@ -142,15 +142,15 @@ public Tuple<string, string> CreateAndValidateCall()
142142
}
143143

144144
/// <summary>
145-
/// Creates and completes an entire recorded call lifecycle. A call should be completed and fully recorded.
146-
/// </summary>
145+
/// Creates and completes an entire recorded call lifecycle. A call should be completed and fully recorded.
146+
/// </summary>
147147
/// <returns>
148148
/// A tuple containing the test id to track this call in the Manteca system and the call id associated with the call in Bandwidth services.
149149
/// </returns>
150-
public Tuple <string,string> CompleteRecordedCall()
150+
public Tuple<string, string> CompleteRecordedCall()
151151
{
152152
mantecaCallBody.AnswerUrl = MANTECA_BASE_URL + "/bxml/startRecording";
153-
Tuple<string,string> createCallResponse = CreateAndValidateCall();
153+
Tuple<string, string> createCallResponse = CreateAndValidateCall();
154154
var testId = createCallResponse.Item1;
155155
var callId = createCallResponse.Item2;
156156

@@ -159,7 +159,7 @@ public Tuple<string, string> CreateAndValidateCall()
159159
JObject callStatusJson = JObject.Parse(callStatus);
160160
var retryCounter = 0;
161161

162-
while(!(Boolean)callStatusJson["callRecorded"] && retryCounter < 40)
162+
while (!(Boolean)callStatusJson["callRecorded"] && retryCounter < 40)
163163
{
164164
System.Threading.Thread.Sleep(5000);
165165
callStatus = GetTestStatus(testId);
@@ -169,7 +169,7 @@ public Tuple<string, string> CreateAndValidateCall()
169169

170170
Assert.True((Boolean)callStatusJson["callRecorded"]);
171171

172-
return(new Tuple <string, string> (testId,callId));
172+
return (new Tuple<string, string>(testId, callId));
173173

174174
}
175175

@@ -195,7 +195,7 @@ public string GetTestStatus(string testId)
195195
path: Environment.GetEnvironmentVariable("MANTECA_BASE_URL") + "/tests/" + testId,
196196
options: options
197197
);
198-
198+
199199
return response.Content.ToString();
200200
}
201201

@@ -205,11 +205,11 @@ public string GetTestStatus(string testId)
205205
[Fact]
206206
public void TestSuccessfulCallRecording()
207207
{
208-
Tuple <string, string> recordedCallResponse = CompleteRecordedCall();
208+
Tuple<string, string> recordedCallResponse = CompleteRecordedCall();
209209
var testId = recordedCallResponse.Item1;
210210
var callId = recordedCallResponse.Item2;
211211

212-
var listCallResponse = recordingApiInstance.ListCallRecordingsWithHttpInfo(accountId,callId);
212+
var listCallResponse = recordingApiInstance.ListCallRecordingsWithHttpInfo(accountId, callId);
213213
Assert.Equal(HttpStatusCode.OK, listCallResponse.StatusCode);
214214

215215
List<CallRecordingMetadata> callRecording = listCallResponse.Data;
@@ -246,17 +246,17 @@ public void TestSuccessfulCallRecording()
246246
var callStatus = GetTestStatus(testId);
247247
var retries = 0;
248248
JObject callStatusJson = JObject.Parse(callStatus);
249-
while(!(Boolean)callStatusJson["callTranscribed"] && retries < 40)
249+
while (!(Boolean)callStatusJson["callTranscribed"] && retries < 40)
250250
{
251251
System.Threading.Thread.Sleep(5000);
252252
callStatus = GetTestStatus(testId);
253253
callStatusJson = JObject.Parse(callStatus);
254254
retries++;
255255
}
256256
Assert.True((Boolean)callStatusJson["callTranscribed"]);
257-
var transcriptionResponse = recordingApiInstance.GetCallTranscriptionWithHttpInfo(accountId, callId, firstRecordingId);
257+
var transcriptionResponse = recordingApiInstance.GetRecordingTranscriptionWithHttpInfo(accountId, callId, firstRecordingId);
258258
Assert.Equal(HttpStatusCode.OK, transcriptionResponse.StatusCode);
259-
259+
260260
var transcription = transcriptionResponse.Data;
261261
Assert.Single(transcription.Transcripts);
262262

@@ -266,11 +266,11 @@ public void TestSuccessfulCallRecording()
266266
Assert.IsType<double>(firstTranscript.Confidence);
267267

268268
// delete transcription
269-
var deleteTranscriptionResponse = recordingApiInstance.DeleteCallTranscriptionWithHttpInfo(accountId, callId, firstRecordingId);
269+
var deleteTranscriptionResponse = recordingApiInstance.DeleteRecordingTranscriptionWithHttpInfo(accountId, callId, firstRecordingId);
270270
Assert.Equal(HttpStatusCode.NoContent, deleteTranscriptionResponse.StatusCode);
271271

272272
// making sure transcription is deleted
273-
ApiException exception = Assert.Throws<ApiException>(() => recordingApiInstance.GetCallTranscription(accountId, callId, firstRecordingId));
273+
ApiException exception = Assert.Throws<ApiException>(() => recordingApiInstance.GetRecordingTranscription(accountId, callId, firstRecordingId));
274274
Assert.Equal(404, exception.ErrorCode);
275275

276276
var deleteRecordingMediaResponse = recordingApiInstance.DeleteRecordingMediaWithHttpInfo(accountId, callId, firstRecordingId);
@@ -290,7 +290,7 @@ public void TestSuccessfulCallRecording()
290290
public void TestSuccessfulUpdateActiveRecording()
291291
{
292292
mantecaCallBody.AnswerUrl = MANTECA_BASE_URL + "/bxml/startLongRecording";
293-
Tuple<string,string> createCallResponse = CreateAndValidateCall();
293+
Tuple<string, string> createCallResponse = CreateAndValidateCall();
294294
var testId = createCallResponse.Item1;
295295
var callId = createCallResponse.Item2;
296296

@@ -299,7 +299,7 @@ public void TestSuccessfulUpdateActiveRecording()
299299
JObject callStatusJson = JObject.Parse(callStatus);
300300
var retryCounter = 0;
301301

302-
while((string)callStatusJson["status"] == "DEAD" && retryCounter < 40)
302+
while ((string)callStatusJson["status"] == "DEAD" && retryCounter < 40)
303303
{
304304
System.Threading.Thread.Sleep(5000);
305305
callStatus = GetTestStatus(testId);
@@ -373,7 +373,7 @@ public void GetCallRecordingUnauthorizedRequest()
373373
/// </summary>
374374
[Fact]
375375
public void GetCallRecordingForbiddenRequest()
376-
{
376+
{
377377
ApiException exception = Assert.Throws<ApiException>(() => forbiddenInstance.GetCallRecordingWithHttpInfo(accountId, testCallId, testRecordingId));
378378
Assert.Equal(403, exception.ErrorCode);
379379
}
@@ -383,7 +383,7 @@ public void GetCallRecordingForbiddenRequest()
383383
/// </summary>
384384
[Fact]
385385
public void GetCallRecordingNotFound()
386-
{
386+
{
387387
ApiException exception = Assert.Throws<ApiException>(() => recordingApiInstance.GetCallRecordingWithHttpInfo(accountId, testCallId, "not-a-recording-id"));
388388
Assert.Equal(404, exception.ErrorCode);
389389
}
@@ -450,62 +450,62 @@ public void TranscribeCallRecordingNotFound()
450450
}
451451

452452
/// <summary>
453-
/// Test GetCallTranscription with an unauthorized client
453+
/// Test GetRecordingTranscription with an unauthorized client
454454
/// </summary>
455455
[Fact]
456-
public void GetCallTranscriptionUnauthorizedRequest()
456+
public void GetRecordingTranscriptionUnauthorizedRequest()
457457
{
458-
ApiException exception = Assert.Throws<ApiException>(() => unauthorizedInstance.GetCallTranscriptionWithHttpInfo(accountId, testCallId, testRecordingId));
458+
ApiException exception = Assert.Throws<ApiException>(() => unauthorizedInstance.GetRecordingTranscriptionWithHttpInfo(accountId, testCallId, testRecordingId));
459459
Assert.Equal(401, exception.ErrorCode);
460460
}
461461

462462
/// <summary>
463-
/// Test GetCallTranscription with a forbidden client
463+
/// Test GetRecordingTranscription with a forbidden client
464464
/// </summary>
465465
[Fact]
466-
public void GetCallTranscriptionForbiddenRequest()
466+
public void GetRecordingTranscriptionForbiddenRequest()
467467
{
468-
ApiException exception = Assert.Throws<ApiException>(() => forbiddenInstance.GetCallTranscriptionWithHttpInfo(accountId, testCallId, testRecordingId));
468+
ApiException exception = Assert.Throws<ApiException>(() => forbiddenInstance.GetRecordingTranscriptionWithHttpInfo(accountId, testCallId, testRecordingId));
469469
Assert.Equal(403, exception.ErrorCode);
470470
}
471471

472472
/// <summary>
473-
/// Test GetCallTranscription with a nonexistent recording id
473+
/// Test GetRecordingTranscription with a nonexistent recording id
474474
/// </summary>
475475
[Fact]
476-
public void GetCallTranscriptionNotFound()
476+
public void GetRecordingTranscriptionNotFound()
477477
{
478-
ApiException exception = Assert.Throws<ApiException>(() => recordingApiInstance.GetCallTranscriptionWithHttpInfo(accountId, testCallId, "not-a-recording-id"));
478+
ApiException exception = Assert.Throws<ApiException>(() => recordingApiInstance.GetRecordingTranscriptionWithHttpInfo(accountId, testCallId, "not-a-recording-id"));
479479
Assert.Equal(404, exception.ErrorCode);
480480
}
481481

482482
/// <summary>
483-
/// Test DeleteCallTranscription with an unauthorized client
483+
/// Test DeleteRecordingTranscription with an unauthorized client
484484
/// </summary>
485485
[Fact]
486-
public void DeleteCallTranscriptionUnauthorizedRequest()
486+
public void DeleteRecordingTranscriptionUnauthorizedRequest()
487487
{
488-
ApiException exception = Assert.Throws<ApiException>(() => unauthorizedInstance.DeleteCallTranscriptionWithHttpInfo(accountId, testCallId, testRecordingId));
488+
ApiException exception = Assert.Throws<ApiException>(() => unauthorizedInstance.DeleteRecordingTranscriptionWithHttpInfo(accountId, testCallId, testRecordingId));
489489
Assert.Equal(401, exception.ErrorCode);
490490
}
491491

492492
/// <summary>
493-
/// Test DeleteCallTranscription with a forbidden client
493+
/// Test DeleteRecordingTranscription with a forbidden client
494494
/// </summary>
495495
[Fact]
496-
public void DeleteCallTranscriptionForbiddenRequest()
496+
public void DeleteRecordingTranscriptionForbiddenRequest()
497497
{
498-
ApiException exception = Assert.Throws<ApiException>(() => forbiddenInstance.DeleteCallTranscriptionWithHttpInfo(accountId, testCallId, testRecordingId));
498+
ApiException exception = Assert.Throws<ApiException>(() => forbiddenInstance.DeleteRecordingTranscriptionWithHttpInfo(accountId, testCallId, testRecordingId));
499499
Assert.Equal(403, exception.ErrorCode);
500500
}
501501

502502
/// <summary>
503-
/// Test DeleteCallTranscription with a nonexistent recording id
503+
/// Test DeleteRecordingTranscription with a nonexistent recording id
504504
/// </summary>
505505
[Fact]
506-
public void DeleteCallTranscriptionNotFound()
506+
public void DeleteRecordingTranscriptionNotFound()
507507
{
508-
ApiException exception = Assert.Throws<ApiException>(() => recordingApiInstance.DeleteCallTranscriptionWithHttpInfo(accountId, testCallId, "not-a-recording-id"));
508+
ApiException exception = Assert.Throws<ApiException>(() => recordingApiInstance.DeleteRecordingTranscriptionWithHttpInfo(accountId, testCallId, "not-a-recording-id"));
509509
Assert.Equal(404, exception.ErrorCode);
510510
}
511511

0 commit comments

Comments
 (0)