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)); }
public void CanNotSet_SpeechVoiceName_IfNameNotIn_InstalledVoices() { _speechSynth.Expect(s => s.SelectedVoice).Return(new CradiatorInstalledVoice("Bob")); _speechSynth.Expect(s => s.GetInstalledVoices()) .Return(new List <CradiatorInstalledVoice> { new CradiatorInstalledVoice("Bob"), }); _voiceSelector.SelectInstalledVoice("DodgyVoiceName"); _speechSynth.AssertWasCalled(s => s.SelectVoice(Arg.Is("Bob"))); }