public void Setup()
 {
     _pipeline = new PipelineReport() {LastBuildTime = DateTime.Now, Name = "Ricky Bobby", Activity = Activity.Idle, BuildState = BuildState.Failure};
     _timeSource = new Mock<ITimeSource>();
     _referenceTime = new DateTime(2011, 3, 27, 15, 2, 0, 0);
     _timeSource.Setup(t => t.Now).Returns(_referenceTime);
 }
 public void Setup()
 {
     _buildServer = new Mock<IBuildServer>();
     _pipeline1 = new PipelineReport()
     {
         Activity = Activity.Paused,
         BuildState = BuildState.Success,
         LastBuildTime = DateTime.Now,
         Name = "Billy Bob",
         LinkURL = "http://blah.blah.com"
     };
     _pipeline2 = new PipelineReport()
     {
         Activity = Activity.Busy,
         BuildState = BuildState.Failure,
         LastBuildTime = DateTime.Now,
         Name = "Billy Jane",
         LinkURL = "http://blah.blah.org"
     };
     _pipeline3 = new PipelineReport()
     {
         Activity = Activity.Busy,
         BuildState = BuildState.Success,
         LastBuildTime = DateTime.Now,
         Name = "Billy Thomas",
         LinkURL = "http://blah.blah.net"
     };
 }
        public void CanShowSuccessfulBuild()
        {
            var successfulPipeline = new PipelineReport()
                                         {
                                             Activity = Activity.Idle,
                                             BuildState = BuildState.Success,
                                             LastBuildTime = DateTime.Now,
                                             LinkURL = "http://ci:8153/go/pipelines/jimbo",
                                             Name = "CI-Trunk"
                                         };

            var pipelineReportVM = new PipelineReportViewModel(successfulPipeline);
            Assert.AreEqual("Success", pipelineReportVM.PipelineState);
        }
        public void CanShowFailedBuild()
        {
            var failedPipeline = new PipelineReport()
            {
                Activity = Activity.Idle,
                BuildState = BuildState.Failure,
                LastBuildTime = DateTime.Now,
                LinkURL = "http://ci:8153/go/pipelines/jimbo",
                Name = "CI-Trunk"
            };

            var pipelineReportVM = new PipelineReportViewModel(failedPipeline);
            Assert.AreEqual("Failure", pipelineReportVM.PipelineState);
        }
 public void Setup()
 {
     _pipeline = new PipelineReport()
                     {
                         Activity = Activity.Busy,
                         BuildState = BuildState.Success,
                         LastBuildTime = DateTime.Now,
                         LinkURL = "http://ci:8153/go/pipelines/jimbo",
                         Name = "CI-Trunk"
                     };
 }
Exemple #6
0
        public void ReportsMergedAndExposedOnCore()
        {
            var core = _kernel.Get<MuroCore>();

            var bs1 = new Mock<IBuildServer>();
            var bs2 = new Mock<IBuildServer>();
            var buildServers = new List<Mock<IBuildServer>>() { bs1, bs2 };

            _burro.Setup(b => b.BuildServers).Returns(new List<IBuildServer>(buildServers.Select(bs => bs.Object)));

            core.Initialise();

            bs1.Raise(b => b.PipelinesUpdated += null, new List<PipelineReport> {SUCCESSFUL_IDLE_PIPELINE});
            Assert.AreEqual(1, core.PipelineReports.Count());
            bs2.Raise(b => b.PipelinesUpdated += null, new List<PipelineReport> { FAILED_IDLE_PIPELINE });
            Assert.AreEqual(2, core.PipelineReports.Count());
            var nowFailed = new PipelineReport()
                                {
                                    Activity = FAILED_IDLE_PIPELINE.Activity,
                                    BuildState = FAILED_IDLE_PIPELINE.BuildState,
                                    Name = SUCCESSFUL_IDLE_PIPELINE.Name
                                };
            bs1.Raise(b => b.PipelinesUpdated += null, new List<PipelineReport> {nowFailed});
            Assert.AreEqual(2, core.PipelineReports.Count());
            Assert.IsTrue(core.PipelineReports.All(pr => pr.Value.BuildState == BuildState.Failure));
        }
 public PipelineReportViewModel(PipelineReport pipelineReport, ITimeSource timeSource)
 {
     _pipelineReport = pipelineReport;
     _timeSource = timeSource;
 }
 public PipelineReportViewModel(PipelineReport pipelineReport)
 {
     _pipelineReport = pipelineReport;
     OpenLinkCommand = new ActionCommand(() => System.Diagnostics.Process.Start(URL));
 }