public void execute_passes_the_speech_text_onto_the_speech_service(string speechText) { var speechService = new SpeechServiceMock(MockBehavior.Loose); var sut = new SayActionBuilder() .WithSpeechService(speechService) .WithSpeechText(speechText) .Build(); sut.Execute(new ExecutionContext()).Subscribe(); speechService .Verify(x => x.Speak(speechText)) .WasCalledExactlyOnce(); }
public void execute_passes_the_speech_text_onto_the_speech_service(string speechText) { var speechService = new SpeechServiceMock(MockBehavior.Loose); var sut = new SayActionBuilder() .WithSpeechService(speechService) .WithSpeechText(speechText) .Build(); sut.Execute(new ExecutionContext()).Subscribe(); speechService .Verify(x => x.Speak(speechText)) .WasCalledExactlyOnce(); }
public void execute_pauses_if_context_is_paused() { var speechService = new SpeechServiceMock(MockBehavior.Loose); var sut = new SayActionBuilder() .WithSpeechService(speechService) .Build(); using (var context = new ExecutionContext()) { context.IsPaused = true; sut.Execute(context).Subscribe(); speechService .Verify(x => x.Speak(It.IsAny<string>())) .WasNotCalled(); } }
public void execute_pauses_if_context_is_paused() { var speechService = new SpeechServiceMock(MockBehavior.Loose); var sut = new SayActionBuilder() .WithSpeechService(speechService) .Build(); using (var context = new ExecutionContext()) { context.IsPaused = true; sut.Execute(context).Subscribe(); speechService .Verify(x => x.Speak(It.IsAny <string>())) .WasNotCalled(); } }