Beispiel #1
0
        public void DistributionList_VoiceName()
        {
            //try to download voice name- this should fail
            WebCallResult res = _tempList.GetVoiceName(@"c:\temp.wav");

            Assert.IsFalse(res.Success, "Empty voice name fetch should return false for newly created list");

            //upload an invalid wav file
            res = _tempList.SetVoiceName("wavcopy.exe", true);
            Assert.IsFalse(res.Success, "Updating invalid voice wav file was not caught");

            //upload a voice name to the list
            res = _tempList.SetVoiceName("Dummy.wav", true);
            Assert.IsTrue(res.Success, "Updating voice name on new distribution list failed: " + res.ToString());

            //upload real name
            res = _tempList.SetVoiceName("temp.wav");
            Assert.IsTrue(res.Success, "Failed uploading voice name:" + res);

            string strFileName = Guid.NewGuid().ToString() + ".wav";

            res = _tempList.GetVoiceName(strFileName);
            Assert.IsTrue(res.Success, "Failed to donwload voice name just uploaded:" + res);
            Assert.IsTrue(File.Exists(strFileName), "Voice name just downloaded does not exist on hard drive:" + strFileName);

            try
            {
                File.Delete(strFileName);
            }
            catch (Exception ex)
            {
                Assert.Fail("Failed to delete temporary file:" + ex);
            }
        }