Ejemplo n.º 1
0
        public void BadPath()
        {
            //Act
            SpeechToText speechToText = new SpeechToText();
            //Arrange
            var path = @"C:\Users\Ambroise\Doc\Downloads\audio-file2.flac";

            //Assert
            Assert.ThrowsException <InvalidFilePathException>(() => speechToText.ConvertAudio(path));
        }
Ejemplo n.º 2
0
        public void BadExtension()
        {
            //Act
            SpeechToText speechToText = new SpeechToText();
            //Arrange
            var path = @"C:\Users\Ambroise\Downloads\audio-file2.core";

            //Assert
            Assert.ThrowsException <UnavailableExtensionException>(() => speechToText.ConvertAudio(path));
        }
Ejemplo n.º 3
0
        public void TestRecupTexte()
        {
            //Act
            SpeechToText speechToText = new SpeechToText();
            //Arrange
            var texte = speechToText.ConvertAudio(@"C:\Users\Ambroise\Downloads\audio-file2.flac");

            //Assert
            //Assert.AreEqual("200", texte.StatusCode);
            Assert.AreEqual("a line of severe thunderstorms with several possible tornadoes is approaching Colorado on Sunday ", texte.Content);
            //Assert.ThrowsException<IBM.Cloud.SDK.Core.Http.Exceptions.ServiceResponseException>(() => speechToText.Convert());
        }