Skip to content

Commit 99878c2

Browse files
committed
test(text-to-speech-v1): update ITs
1 parent c569124 commit 99878c2

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

Tests/TextToSpeechIntegrationTests.cs

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,9 @@ public IEnumerator TestAddCustomPrompts()
557557
};
558558

559559
MemoryStream file = new MemoryStream();
560+
FileStream fs = File.OpenRead(wavFilePath);
560561

562+
fs.CopyTo(file);
561563
Prompt prompt = null;
562564

563565
service.AddCustomPrompt(
@@ -624,25 +626,49 @@ public IEnumerator TestGetCustomPrompts()
624626
};
625627

626628
MemoryStream file = new MemoryStream();
629+
FileStream fs = File.OpenRead(wavFilePath);
627630

631+
fs.CopyTo(file);
632+
string promptId = "";
628633
Prompt prompt = null;
629634

630-
service.GetCustomPrompt(
635+
service.AddCustomPrompt(
631636
callback: (DetailedResponse<Prompt> response, IBMError error) =>
632637
{
633-
Log.Debug("TextToSpeechServiceV1IntegrationTests", "GetCustomPrompt result: {0}", response.Response);
638+
Log.Debug("TextToSpeechServiceV1IntegrationTests", "AddCustomPrompt result: {0}", response.Response);
634639
prompt = response.Result;
635640
Assert.IsNotNull(prompt);
636641
Assert.IsNotNull(prompt.Status);
637642
Assert.IsNull(error);
643+
promptId = prompt.PromptId;
638644
},
639645
customizationId: customizationId,
640-
promptId: "testId"
646+
promptId: "testId",
647+
metadata: promptMetadata,
648+
file: file
641649
);
642650

643651
while (prompt == null)
644652
yield return null;
645653

654+
Prompt getPrompt = null;
655+
656+
service.GetCustomPrompt(
657+
callback: (DetailedResponse<Prompt> response, IBMError error) =>
658+
{
659+
Log.Debug("TextToSpeechServiceV1IntegrationTests", "GetCustomPrompt result: {0}", response.Response);
660+
getPrompt = response.Result;
661+
Assert.IsNotNull(getPrompt);
662+
Assert.IsNotNull(getPrompt.Status);
663+
Assert.IsNull(error);
664+
},
665+
customizationId: customizationId,
666+
promptId: promptId
667+
);
668+
669+
while (getPrompt == null)
670+
yield return null;
671+
646672
bool isComplete = false;
647673
service.DeleteCustomModel(
648674
callback: (DetailedResponse<object> response, IBMError error) =>
@@ -689,6 +715,9 @@ public IEnumerator TestDeleteCustomPrompts()
689715
};
690716

691717
MemoryStream file = new MemoryStream();
718+
FileStream fs = File.OpenRead(wavFilePath);
719+
720+
fs.CopyTo(file);
692721

693722
Prompt prompt = null;
694723

0 commit comments

Comments
 (0)