public void execute_passes_the_audio_name_onto_the_audio_service(string audioName)
        {
            var audioService = new AudioServiceMock(MockBehavior.Loose);
            var sut = new AudioActionBuilder()
                .WithAudioService(audioService)
                .WithAudioName(audioName)
                .Build();

            sut.Execute(new ExecutionContext()).Subscribe();

            audioService
                .Verify(x => x.Play(audioName))
                .WasCalledExactlyOnce();
        }
Example #2
0
        public void execute_passes_the_audio_name_onto_the_audio_service(string audioName)
        {
            var audioService = new AudioServiceMock(MockBehavior.Loose);
            var sut          = new AudioActionBuilder()
                               .WithAudioService(audioService)
                               .WithAudioName(audioName)
                               .Build();

            sut.Execute(new ExecutionContext()).Subscribe();

            audioService
            .Verify(x => x.Play(audioName))
            .WasCalledExactlyOnce();
        }
Example #3
0
        public void execute_pauses_if_context_is_paused()
        {
            var audioService = new AudioServiceMock(MockBehavior.Loose);
            var sut          = new AudioActionBuilder()
                               .WithAudioService(audioService)
                               .Build();
            var context = new ExecutionContext();

            context.IsPaused = true;

            sut
            .Execute(context)
            .Subscribe();

            audioService
            .Verify(x => x.Play(It.IsAny <string>()))
            .WasNotCalled();
        }
        public void execute_pauses_if_context_is_paused()
        {
            var audioService = new AudioServiceMock(MockBehavior.Loose);
            var sut = new AudioActionBuilder()
                .WithAudioService(audioService)
                .Build();

            using (var context = new ExecutionContext())
            {
                context.IsPaused = true;

                sut.Execute(context).Subscribe();

                audioService
                    .Verify(x => x.Play(It.IsAny<string>()))
                    .WasNotCalled();
            }
        }