public void PlaysTheCorrectSoundFileWhenBuildTransitionsOccur()
		{
			AudioFiles files = new AudioFiles();
			files.StillFailingBuildSound = "anotherFailed.wav";
			files.StillSuccessfulBuildSound = "anotherSuccess.wav";
			files.BrokenBuildSound = "broken.wav";
			files.FixedBuildSound = "fixed.wav";

			new BuildTransitionSoundPlayer(
				stubProjectMonitor, 
				(IAudioPlayer) mockAudioPlayer.MockInstance,
				files);

			mockAudioPlayer.Expect("Play", files.BrokenBuildSound);
			stubProjectMonitor.OnBuildOccurred(new MonitorBuildOccurredEventArgs(stubProjectMonitor, BuildTransition.Broken));

			mockAudioPlayer.Expect("Play", files.FixedBuildSound);
			stubProjectMonitor.OnBuildOccurred(new MonitorBuildOccurredEventArgs(stubProjectMonitor, BuildTransition.Fixed));

			mockAudioPlayer.Expect("Play", files.StillFailingBuildSound);
			stubProjectMonitor.OnBuildOccurred(new MonitorBuildOccurredEventArgs(stubProjectMonitor, BuildTransition.StillFailing));
			
			mockAudioPlayer.Expect("Play", files.StillSuccessfulBuildSound);
			stubProjectMonitor.OnBuildOccurred(new MonitorBuildOccurredEventArgs(stubProjectMonitor, BuildTransition.StillSuccessful));

			mockAudioPlayer.Verify();
		}
        public BuildTransitionSoundPlayer(IProjectMonitor monitor, IAudioPlayer audioPlayer, AudioFiles configuration)
        {
            this.audioPlayer = audioPlayer;

            if (configuration != null)
            {
                soundFileLookup[BuildTransition.Broken] = configuration.BrokenBuildSound;
                soundFileLookup[BuildTransition.Fixed] = configuration.FixedBuildSound;
                soundFileLookup[BuildTransition.StillFailing] = configuration.StillFailingBuildSound;
                soundFileLookup[BuildTransition.StillSuccessful] = configuration.StillSuccessfulBuildSound;
            }

            monitor.BuildOccurred += new MonitorBuildOccurredEventHandler(Monitor_BuildOccurred);
        }
		public void WhenATransitionIsNullOrEmptyStringNoAudioIsPlayed()
		{
			AudioFiles files = new AudioFiles();
			files.StillSuccessfulBuildSound =string.Empty;
			files.StillFailingBuildSound = null;

			new BuildTransitionSoundPlayer(
				stubProjectMonitor, 
				(IAudioPlayer) mockAudioPlayer.MockInstance,
				files);

			mockAudioPlayer.ExpectNoCall("Play", typeof(string));
			stubProjectMonitor.OnBuildOccurred(new MonitorBuildOccurredEventArgs(stubProjectMonitor, BuildTransition.StillSuccessful));

			
			mockAudioPlayer.ExpectNoCall("Play", typeof(string));
			stubProjectMonitor.OnBuildOccurred(new MonitorBuildOccurredEventArgs(stubProjectMonitor, BuildTransition.StillFailing));
		}