Exemplo n.º 1
0
        public void AddPipeline(XmlNode xmlNode)
        {
            if (xmlNode.Attributes != null)
            {
                var pipelineName = xmlNode.Attributes["name"].Value;
                if (pipelineName.IndexOf("::", StringComparison.Ordinal) ==
                    pipelineName.LastIndexOf("::", StringComparison.Ordinal))
                {
                    DateTime lastBuildTimeDateTime;
                    DateTime.TryParse(xmlNode.Attributes["lastBuildTime"].Value, out lastBuildTimeDateTime);

                    var pipeline = new Pipeline
                        {
                            Name = pipelineName,
                            Activity = xmlNode.Attributes["activity"].Value,
                            LastBuildStatus = xmlNode.Attributes["lastBuildStatus"].Value,
                            LastBuildLabel = xmlNode.Attributes["lastBuildLabel"].Value,
                            LastBuildTimeDateTime = lastBuildTimeDateTime,
                            WebUrl = xmlNode.Attributes["webUrl"].Value
                        };
                    Pipelines.Add(pipeline);
                }
            }
        }
Exemplo n.º 2
0
 public void Status_Should_Be_Failed_If_LastBuildStatus_Failed()
 {
     var pipeline = new Pipeline() { LastBuildStatus = "Failure" };
     Assert.AreEqual(pipeline.Status, "failed");
 }
Exemplo n.º 3
0
 public void Status_Should_Be_Passed_If_LastBuildStatus_Passed()
 {
     var pipeline = new Pipeline() {LastBuildStatus = "Passed"};
     Assert.AreEqual(pipeline.Status, "passed");
 }
Exemplo n.º 4
0
 public void Should_Set_LastBuildTimeDateTime_If_Correct_DateTime()
 {
     var pipeline = new Pipeline() {LastBuildTimeDateTime = DateTime.Now};
     Assert.AreEqual((pipeline.LastBuildTimeDateTime - DateTime.Now).Minutes, 0);
 }
Exemplo n.º 5
0
 public void Should_Set_LastBuildLabelInt_When_LastBuildLabel_Set()
 {
     var pipeline = new Pipeline(){LastBuildLabel = "10001"};
     Assert.AreEqual(pipeline.LastBuildLabelInt, 10001);
 }
Exemplo n.º 6
0
 public void PipelineGroupName_Should_Be_What_It_Says_On_The_Tin()
 {
     var pipeline = new Pipeline() { Name = "Trunk-Blah-Blah_blag498234y9hwd-k[kgermeopupgapsd;a#'asc.';d.vs[" };
     Assert.AreEqual(pipeline.PipelineGroupName, "Trunk");
 }
Exemplo n.º 7
0
 public void LastBuildLabelInt_Should_Not_Throw_Exception_When_LastBuildLabel_Not_Int()
 {
     var pipeline = new Pipeline() { LastBuildLabel = "v10001" };
     Assert.AreEqual(pipeline.LastBuildLabelInt, 0);
 }
Exemplo n.º 8
0
 public void LastBuildLabelInt_Should_Not_Throw_Exception_When_LastBuildLabel_Is_Invalid()
 {
     var pipeline = new Pipeline() { LastBuildLabel = "${PipelineName}" };
     Assert.AreEqual(pipeline.LastBuildLabelInt, 0);
 }