Example #1
0
        public void SetUp()
        {
            _buildBuster      = Create.Stub <IBuildBuster>();
            _speechTextParser = new SpeechTextParser(_buildBuster);

            _failedProject = new ProjectStatus("ProjectZombie")
            {
                LastBuildStatus = ProjectStatus.FAILURE,
            };
        }
        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);
        }
Example #3
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);
        }
        public void SetUp()
        {
            _audioPlayer = MockRepository.GenerateMock <IAudioPlayer>();
            _buildBuster = MockRepository.GenerateMock <IBuildBuster>();

            _configSettings = new ConfigSettings
            {
                BrokenBuildSound = BrokenSound,
                FixedBuildSound  = FixedSound,
                PlaySounds       = true
            };

            _speechMaker = new SpeechMaker(_configSettings, new SpeechTextParser(_buildBuster));

            _discJockey          = new DiscJockey(_configSettings, _audioPlayer, _speechMaker);
            _projectList1Success = new List <ProjectStatus> {
                new ProjectStatus("bla")
                {
                    LastBuildStatus = ProjectStatus.SUCCESS
                }
            };
            _projectList1Failure = new List <ProjectStatus> {
                new ProjectStatus("bla")
                {
                    LastBuildStatus = ProjectStatus.FAILURE
                }
            };

            _projectList2BothSuccess = new List <ProjectStatus>
            {
                new ProjectStatus("bla")
                {
                    LastBuildStatus = ProjectStatus.SUCCESS
                },
                new ProjectStatus("bla2")
                {
                    LastBuildStatus = ProjectStatus.SUCCESS
                }
            };

            _projectList2BothFailure = new List <ProjectStatus>
            {
                new ProjectStatus("bla")
                {
                    LastBuildStatus = ProjectStatus.FAILURE
                },
                new ProjectStatus("bla2")
                {
                    LastBuildStatus = ProjectStatus.FAILURE
                }
            };
        }
        public void SetUp()
        {
            _buildBuster = Create.Stub<IBuildBuster>();

            _buildBusterDecorator =
                new BuildBusterFullNameDecorator(_buildBuster, new ConfigSettings
                {
                    UsernameMap = new Dictionary<string, string>
                    {
                        {"jbloggs", "Joe Bloggs"},
                        {"am", "Ace McAwesome"}
                    }}
                );
        }
Example #6
0
        public void SetUp()
        {
            _buildBuster = Create.Stub <IBuildBuster>();

            _buildBusterDecorator =
                new BuildBusterFullNameDecorator(_buildBuster, new ConfigSettings
            {
                UsernameMap = new Dictionary <string, string>
                {
                    { "jbloggs", "Joe Bloggs" },
                    { "am", "Ace McAwesome" }
                }
            }
                                                 );
        }
Example #7
0
 public SpeechTextParser([InjectBuildBusterFullNameDecorator] IBuildBuster buildBuster)
 {
     _buildBuster = buildBuster;
 }
 public SpeechTextParser([InjectBuildBusterFullNameDecorator] IBuildBuster buildBuster)
 {
     _buildBuster = buildBuster;
 }
 protected override IValueConverter CreateConverter()
 {
     _buildBuster = MockRepository.GenerateMock<IBuildBuster>();
     return new OneBreakerConverter(_buildBuster);
 }
 public ImagePathConverter([InjectBuildBusterImageDecorator] IBuildBuster buildBuster)
 {
     _buildBuster = buildBuster;
 }
 public BuildBusterImageDecorator([InjectBuildBuster] IBuildBuster buildBuster, IAppLocation appLocation)
 {
     _buildBuster = buildBuster;
     _imageFolder = Path.Combine(appLocation.DirectoryName, "images");
 }
Example #12
0
 public BuildBusterFullNameDecorator([InjectBuildBuster] IBuildBuster buildBuster, IConfigSettings configSettings)
 {
     _buildBuster = buildBuster;
     _usernameMap = configSettings.UsernameMap;
     configSettings.AddObserver(this);
 }
 public BuildBusterImageDecorator([InjectBuildBuster] IBuildBuster buildBuster, IAppLocation appLocation)
 {
     _buildBuster = buildBuster;
     _imageFolder = Path.Combine(appLocation.DirectoryName, "images");
 }
Example #14
0
 public OneBreakerConverter([InjectBuildBuster] IBuildBuster buildBuster)
 {
     _buildBuster = buildBuster;
 }
        public void SetUp()
        {
            _audioPlayer = MockRepository.GenerateMock<IAudioPlayer>();
            _buildBuster = MockRepository.GenerateMock<IBuildBuster>();

            _configSettings = new ConfigSettings
            {
                BrokenBuildSound = BrokenSound,
                FixedBuildSound = FixedSound,
                PlaySounds = true
            };

            _speechMaker = new SpeechMaker(_configSettings, new SpeechTextParser(_buildBuster));

            _discJockey = new DiscJockey(_configSettings, _audioPlayer, _speechMaker);
            _projectList1Success = new List<ProjectStatus> { new ProjectStatus("bla")
                                                             {
                                                             	LastBuildStatus = ProjectStatus.SUCCESS
                                                             } };
            _projectList1Failure = new List<ProjectStatus> { new ProjectStatus("bla")
                                                             {
                                                             	LastBuildStatus = ProjectStatus.FAILURE
                                                             } };

            _projectList2BothSuccess = new List<ProjectStatus>
            {
                new ProjectStatus("bla") {LastBuildStatus = ProjectStatus.SUCCESS},
                new ProjectStatus("bla2") {LastBuildStatus = ProjectStatus.SUCCESS}
            };

            _projectList2BothFailure = new List<ProjectStatus>
            {
                new ProjectStatus("bla") {LastBuildStatus = ProjectStatus.FAILURE},
                new ProjectStatus("bla2") {LastBuildStatus = ProjectStatus.FAILURE}
            };
        }
 protected override IValueConverter CreateConverter()
 {
     _buildBuster = MockRepository.GenerateMock <IBuildBuster>();
     return(new OneBreakerConverter(_buildBuster));
 }
 protected override IValueConverter CreateConverter()
 {
     _buildBuster = Create.Mock <IBuildBuster>();
     return(new ImagePathConverter(_buildBuster));
 }
Example #18
0
 public OneBreakerConverter([InjectBuildBuster] IBuildBuster buildBuster)
 {
     _buildBuster = buildBuster;
 }
 protected override IValueConverter CreateConverter()
 {
     _buildBuster = Create.Mock<IBuildBuster>();
     return new ImagePathConverter(_buildBuster);
 }
Example #20
0
 public ImagePathConverter([InjectBuildBusterImageDecorator] IBuildBuster buildBuster)
 {
     _buildBuster = buildBuster;
 }
 public BuildBusterFullNameDecorator([InjectBuildBuster] IBuildBuster buildBuster, IConfigSettings configSettings)
 {
     _buildBuster = buildBuster;
     _usernameMap = configSettings.UsernameMap;
     configSettings.AddObserver(this);
 }