Inheritance: IAudioPlayer, IConfigObserver
 public void SpeechSynthesisTest()
 {
     var builder = new PromptBuilder();
     builder.AppendText("The build breaker is, dave.");
     var player = new AudioPlayer(new CradiatorSpeechSynthesizer(new SpeechSynthesizer()), new ConfigSettings(),
                                  new VoiceSelector(null), new AppLocation());
     player.Say(builder);
 }
Example #2
0
        public void DoesNotSay_If_PlaySpeech_IsOff()
        {
            _speechSynth.Expect(s => s.GetInstalledVoices()).Return(new List<CradiatorInstalledVoice>());

            var audioPlayer = new AudioPlayer(_speechSynth,
                                              new ConfigSettings { PlaySpeech = false },
                                              new VoiceSelector(_speechSynth), _appLocation);
            audioPlayer.Say(new PromptBuilder());
            _speechSynth.AssertWasNotCalled(s=>s.SpeakAsync(Arg<PromptBuilder>.Is.Anything));
        }
Example #3
0
 public void DoesSay_If_PlaySpeech_IsOn()
 {
     _speechSynth.Expect(s => s.GetInstalledVoices()).Return(new List<CradiatorInstalledVoice>
                                                             {
                                                                 new CradiatorInstalledVoice("Bob")
                                                             });
     var audioPlayer = new AudioPlayer(_speechSynth,
                                       new ConfigSettings { PlaySpeech = true, SpeechVoiceName = "Bob" },
                                       new VoiceSelector(_speechSynth), _appLocation);
     audioPlayer.Say(new PromptBuilder());
     _speechSynth.AssertWasCalled(s => s.SpeakAsync(Arg<PromptBuilder>.Is.Anything));
 }