Ejemplo n.º 1
0
        public CreateSound(CfCreateSound cfCreateSound)
        {
            Name = cfCreateSound.Name;

            Item = cfCreateSound.Item.GetType() == typeof(CfCreateSoundRecordingCall) ?
                   new CreateSoundRecordingCall(((CfCreateSoundRecordingCall)cfCreateSound.Item).ToNumber) : cfCreateSound.Item;
            SoundTextVoice = cfCreateSound.SoundTextVoice;
        }
Ejemplo n.º 2
0
        public void Test_CreateSoundComplete()
        {
            var createSound = new CfCreateSound
            {
                Name           = "SoundText_1",
                Item           = "Text sound test",
                SoundTextVoice = "FEMALE1"
            };
            var id = Client.CreateSound(createSound, CfSoundFormat.Mp3);

            Assert.IsNotNull(id);
        }
Ejemplo n.º 3
0
        public void Test_CreateSoundMandatoryFieldsRecordingCall()
        {
            var createSound = new CfCreateSound
            {
                Name = "SoundRecordingCall_1",
                Item = new CfCreateSoundRecordingCall
                {
                    ToNumber = VerifyFromNumber
                },
            };
            var id = Client.CreateSound(createSound, CfSoundFormat.Mp3);

            Assert.IsNotNull(id);
        }
Ejemplo n.º 4
0
        public void Test_CreateSoundMandatoryFields()
        {
            var stream    = File.OpenRead("../../Files/test.mp3");
            var fileBytes = new byte[stream.Length];

            stream.Read(fileBytes, 0, fileBytes.Length);
            stream.Close();

            var createSound = new CfCreateSound
            {
                Item = fileBytes,
            };
            var id = Client.CreateSound(createSound, CfSoundFormat.Mp3);

            Assert.IsNotNull(id);
        }
Ejemplo n.º 5
0
        public void Test_CreateSoundInvalidData()
        {
            var stream = File.OpenRead("../../Files/test.png");

            var fileBytes = new byte[stream.Length];

            stream.Read(fileBytes, 0, fileBytes.Length);
            stream.Close();

            var createSound = new CfCreateSound
            {
                Item = fileBytes,
            };

            AssertClientException <WebException, FaultException <ServiceFaultInfo> >(() => Client.CreateSound(createSound, CfSoundFormat.Mp3));
        }
Ejemplo n.º 6
0
 public long CreateSound(CfCreateSound cfCreateSound, CfSoundFormat cfSoundFormat)
 {
     return(CallService.CreateSound(new CreateSound(cfCreateSound)));
 }
Ejemplo n.º 7
0
        public long CreateSound(CfCreateSound cfCreateSound, CfSoundFormat cfSoundFormat)
        {
            var resource = BaseRequest <ResourceReference>(HttpMethod.Post, new CreateSound(cfCreateSound), new CallfireRestRoute <Call>(null, CallRestRouteObjects.Sound, null), cfSoundFormat);

            return(resource.Id);
        }