コード例 #1
0
        public void SetUp()
        {
            _buildBuster = MockRepository.GenerateStub<IBuildBuster>();
            _appLocation = MockRepository.GenerateStub<IAppLocation>();

            // it is very important that we don't rely on (and therefore retest) the 'decorated' BuildBuster object
            // If we did, then that class failing would fail this test too (a classic case of fickle (and therefore bad) tests
            _appLocation.Stub(a => a.DirectoryName).Return(DirectoryName);

            _buildBusterDecorator = new BuildBusterImageDecorator(_buildBuster, _appLocation);
        }
コード例 #2
0
        public void SetUp()
        {
            _buildBuster = MockRepository.GenerateStub <IBuildBuster>();
            _appLocation = MockRepository.GenerateStub <IAppLocation>();

            // it is very important that we don't rely on (and therefore retest) the 'decorated' BuildBuster object
            // If we did, then that class failing would fail this test too (a classic case of fickle (and therefore bad) tests
            _appLocation.Stub(a => a.DirectoryName).Return(DirectoryName);

            _buildBusterDecorator = new BuildBusterImageDecorator(_buildBuster, _appLocation);
        }
コード例 #3
0
ファイル: AudioPlayer.cs プロジェクト: Bill-Manning/Cradiator
        public AudioPlayer(ISpeechSynthesizer speechSynth, IConfigSettings configSettings,
                           VoiceSelector voiceSelector, IAppLocation appLocation)
        {
            _voiceSelector   = voiceSelector;
            _speechVoiceName = configSettings.SpeechVoiceName;
            _playSounds      = configSettings.PlaySounds;
            _playSpeech      = configSettings.PlaySpeech;
            _wavFileFolder   = Path.Combine(appLocation.DirectoryName, "sounds");

            _speechSynth      = speechSynth;
            _speechSynth.Rate = -2;                     //TODO might be useful as configuration

            configSettings.AddObserver(this);
        }
コード例 #4
0
ファイル: AudioPlayer.cs プロジェクト: PandaWood/Cradiator
        public AudioPlayer(ISpeechSynthesizer speechSynth, IConfigSettings configSettings, 
						   VoiceSelector voiceSelector, IAppLocation appLocation)
        {
            _voiceSelector = voiceSelector;
            _speechVoiceName = configSettings.SpeechVoiceName;
            _playSounds = configSettings.PlaySounds;
            _playSpeech = configSettings.PlaySpeech;
            _wavFileFolder = Path.Combine(appLocation.DirectoryName, "sounds");

            _speechSynth = speechSynth;
            _speechSynth.Rate = -2;		//TODO might be useful as configuration

            configSettings.AddObserver(this);
        }
コード例 #5
0
 public BuildBusterImageDecorator([InjectBuildBuster] IBuildBuster buildBuster, IAppLocation appLocation)
 {
     _buildBuster = buildBuster;
     _imageFolder = Path.Combine(appLocation.DirectoryName, "images");
 }
コード例 #6
0
 public BuildBusterImageDecorator([InjectBuildBuster] IBuildBuster buildBuster, IAppLocation appLocation)
 {
     _buildBuster = buildBuster;
     _imageFolder = Path.Combine(appLocation.DirectoryName, "images");
 }
コード例 #7
0
 public void SetUp()
 {
     _speechSynth = MockRepository.GenerateMock<ISpeechSynthesizer>();
     _appLocation = MockRepository.GenerateMock<IAppLocation>();
     _appLocation.Stub(a => a.DirectoryName).Return(@"c:\bla");
 }
コード例 #8
0
 public void SetUp()
 {
     _speechSynth = Create.Mock <ISpeechSynthesizer>();
     _appLocation = Create.Stub <IAppLocation>();
     _appLocation.Stub(a => a.DirectoryName).Return(@"c:\bla");
 }
コード例 #9
0
 public void SetUp()
 {
     _speechSynth = Create.Mock<ISpeechSynthesizer>();
     _appLocation = Create.Stub<IAppLocation>();
     _appLocation.Stub(a => a.DirectoryName).Return(@"c:\bla");
 }