Exemplo n.º 1
0
        public void CanPlaySound_ThenUpdateConfig_ThenNotPlaySound()
        {
            _discJockey = new DiscJockey(new ConfigSettings {
                PlaySounds = false
            }, _audioPlayer, _speechMaker);

            _discJockey.PlaySounds(_projectList1Success);
            _discJockey.PlaySounds(_projectList1Failure);
            _audioPlayer.AssertWasNotCalled(a => a.Play(BrokenSound));

            _discJockey.ConfigUpdated(new ConfigSettings {
                PlaySounds = true, BrokenBuildSound = BrokenSound
            });

            _discJockey.PlaySounds(_projectList1Success);
            _discJockey.PlaySounds(_projectList1Failure);
            _audioPlayer.AssertWasCalled(a => a.Play(BrokenSound));
        }
Exemplo n.º 2
0
        void DataFetched(object sender, RunWorkerCompletedEventArgs e)
        {
            try
            {
                if (e.Error != null)
                {
                    _fetchExceptionHandler.Handle(e.Error);
                    return;
                }

                var xmlResults = e.Result as IEnumerable <string>;
                IEnumerable <ProjectStatus> projectData = new List <ProjectStatus>();
                if (xmlResults != null)
                {
                    projectData = xmlResults.SelectMany(xml =>
                    {
                        try
                        {
                            return(_transformer.Transform(xml));
                        }
                        catch (Exception exception)
                        {
                            _log.Error(exception);
                            return(new List <ProjectStatus>());
                        }
                    });
                }

                _view.DataContext = new ViewModels.ViewDataViewModel(_viewSettings, projectData);

                _discJockey.PlaySounds(projectData);
            }
            finally
            {
                _view.ShowProgress = false;

                _pollTimer.Start();
                _countdownTimer.Reset();
                _countdownTimer.Start();
            }
        }
Exemplo n.º 3
0
        public void CanPlay_BuildStatus_If_SuccessThenFailure()
        {
            _discJockey.PlaySounds(_projectList1Success);
            _audioPlayer.AssertWasNotCalled(a => a.Play(BrokenSound));

            _discJockey.PlaySounds(_projectList1Failure);
            _audioPlayer.AssertWasCalled(a => a.Play(BrokenSound));
        }