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 CanGetInstalledVoice_WithoutSelecting() { _speechSynth.Expect(s => s.SelectedVoice).Return(new CradiatorInstalledVoice("Bob")); _speechSynth.Expect(s => s.GetInstalledVoices()) .Return(new List <CradiatorInstalledVoice> { new CradiatorInstalledVoice("Bob"), }); Assert.That(_voiceSelector.GetClosestMatchingInstalledVoice("DodgyVoiceName"), Is.EqualTo(new CradiatorInstalledVoice("Bob"))); _speechSynth.AssertWasNotCalled(s => s.SelectVoice(Arg <string> .Is.Anything)); }