public void ProcessedDisplayName5()
        {
            var displayablePipeline = new DisplayablePipeline("Abcdefghijklmnopqrstuvwxyz", null)
                {
                    HideBuildInfo = true
                };

            Assert.That(displayablePipeline.ProcessedDisplayName, Is.EqualTo("Abcdefghijklmnopqrstuvwxyz"));
        }
        public void ProcessedDisplayName_should_be_trunctated_to_23_characters_if_name_is_longer_that_27_characters_and_hiding_build_info()
        {
            var displayablePipeline = new DisplayablePipeline("Abcdefghijklmnopqrstuvwxyz1", null)
                {
                    HideBuildInfo = true
                };

            Assert.That(displayablePipeline.ProcessedDisplayName, Is.EqualTo("Abcdefghijklmnopqrstuvwx…"));
        }
示例#3
0
        public void NameClass_should_be_long_if_hiding_build_info()
        {
            var displayablePipeline = new DisplayablePipeline("A.Name", null)
            {
                HideBuildInfo = true
            };

            Assert.That(displayablePipeline.NameClass, Is.EqualTo("class=\"long\""));
        }
        public void NameClass_should_be_long_if_hiding_build_info()
        {
            var displayablePipeline = new DisplayablePipeline("A.Name", null)
                {
                    HideBuildInfo = true
                };

            Assert.That(displayablePipeline.NameClass, Is.EqualTo("class=\"long\""));
        }
示例#5
0
        public void ProcessedDisplayName5()
        {
            var displayablePipeline = new DisplayablePipeline("Abcdefghijklmnopqrstuvwxyz", null)
            {
                HideBuildInfo = true
            };

            Assert.That(displayablePipeline.ProcessedDisplayName, Is.EqualTo("Abcdefghijklmnopqrstuvwxyz"));
        }
示例#6
0
        public void ProcessedDisplayName_should_be_trunctated_to_16_characters_if_name_is_more_than_15_characters_and_not_hiding_build_info()
        {
            var displayablePipeline = new DisplayablePipeline("Abcdefghijklmnop", null)
            {
                HideBuildInfo = false
            };

            Assert.That(displayablePipeline.ProcessedDisplayName, Is.EqualTo("Abcdefghijklmno…"));
        }
示例#7
0
        public void ProcessedDisplayName_should_be_trunctated_to_23_characters_if_name_is_longer_that_27_characters_and_hiding_build_info()
        {
            var displayablePipeline = new DisplayablePipeline("Abcdefghijklmnopqrstuvwxyz1", null)
            {
                HideBuildInfo = true
            };

            Assert.That(displayablePipeline.ProcessedDisplayName, Is.EqualTo("Abcdefghijklmnopqrstuvwx…"));
        }
示例#8
0
        public void NameClass_should_be_blank_if_not_hiding_build_info()
        {
            var displayablePipeline = new DisplayablePipeline("A.Name", null)
            {
                HideBuildInfo = false
            };

            Assert.That(displayablePipeline.NameClass, Is.EqualTo(string.Empty));
        }
        public void ProcessedDisplayName_should_not_be_trunctated_if_name_is_less_that_16_characters_and_not_hiding_build_info()
        {
            var displayablePipeline = new DisplayablePipeline("Abcdefghijklmno", null)
                {
                    HideBuildInfo = false
                };

            Assert.That(displayablePipeline.ProcessedDisplayName, Is.EqualTo("Abcdefghijklmno"));
        }
        public void NameClass_should_be_blank_if_not_hiding_build_info()
        {
            var displayablePipeline = new DisplayablePipeline("A.Name", null)
                {
                    HideBuildInfo = false
                };

            Assert.That(displayablePipeline.NameClass, Is.EqualTo(string.Empty));
        }
示例#11
0
        public void should_not_truncate_last_build_label_if_less_than_16_characters()
        {
            var displayablePipeline = new DisplayablePipeline("Name", "123456789012345")
            {
                Stages = new List <IStage>
                {
                    new PassedStage("Stage 1", null, "2000-01-01")
                }
            };

            Assert.That(displayablePipeline.ProcessedLastBuildLabel, Is.EqualTo("123456789012345"));
        }
示例#12
0
        public void SetsStyleWidth()
        {
            var displayablePipeline = new DisplayablePipeline("Name", null)
            {
                Stages = new List <IStage>
                {
                    new PassedStage("Stage 1", null, "2000-01-01"),
                    new PassedStage("Stage 2", null, "2000-01-01")
                }
            };

            Assert.That(displayablePipeline.PipelineStageWidth, Is.EqualTo(48));
        }
示例#13
0
        public static List <DisplayablePipeline> DeserialisePipelinesFromXmlAndCleanseContent(XmlDocument xmlDoc)
        {
            var allProjects = Deserialise(xmlDoc);

            var results = new List <DisplayablePipeline>();

            foreach (var project in allProjects.Results)
            {
                var pipelineNameParts = project.Name.Split(new[] { " :: " }, StringSplitOptions.None);
                if (pipelineNameParts.Count() != 2)
                {
                    continue;
                }

                var pipelineName = pipelineNameParts[0];
                var stageName    = pipelineNameParts[1];

                if (pipelineName.Contains("Shared-"))
                {
                    if (results.All(p => p.Name != "Shared"))
                    {
                        results.Add(new DisplayablePipeline("Shared", ""));
                    }
                    var sharedPipeline = results.Find(p => p.Name == "Shared");
                    sharedPipeline.AddStage(CreateStage(pipelineName, project.LastBuildStatus, project.Activity, project.LastBuildTime));
                    continue;
                }


                if (results.All(p => p.Name != pipelineName))
                {
                    var pipeline = new DisplayablePipeline(pipelineName, project.LastBuildLabel);
                    pipeline.Stages.Add(CreateStage(stageName, project.LastBuildStatus, project.Activity, project.LastBuildTime));
                    results.Add(pipeline);
                }
                else
                {
                    var pipeline = results.Find(p => p.Name == pipelineName);
                    pipeline.Stages.Add(CreateStage(stageName, project.LastBuildStatus, project.Activity, project.LastBuildTime));
                }
            }

            return(results);
        }
        public static List<DisplayablePipeline> DeserialisePipelinesFromXmlAndCleanseContent(XmlDocument xmlDoc)
        {
            var allProjects = Deserialise(xmlDoc);

            var results = new List<DisplayablePipeline>();
            foreach (var project in allProjects.Results)
            {
                var pipelineNameParts = project.Name.Split(new[] { " :: " }, StringSplitOptions.None);
                if (pipelineNameParts.Count() != 2)
                    continue;

                var pipelineName = pipelineNameParts[0];
                var stageName = pipelineNameParts[1];

                if (pipelineName.Contains("Shared-"))
                {
                    if (results.All(p => p.Name != "Shared"))
                        results.Add(new DisplayablePipeline("Shared", ""));
                    var sharedPipeline = results.Find(p => p.Name == "Shared");
                    sharedPipeline.AddStage(CreateStage(pipelineName, project.LastBuildStatus, project.Activity, project.LastBuildTime));
                    continue;
                }

                if (results.All(p => p.Name != pipelineName))
                {
                    var pipeline = new DisplayablePipeline(pipelineName, project.LastBuildLabel);
                    pipeline.Stages.Add(CreateStage(stageName, project.LastBuildStatus, project.Activity, project.LastBuildTime));
                    results.Add(pipeline);
                }
                else
                {
                    var pipeline = results.Find(p => p.Name == pipelineName);
                    pipeline.Stages.Add(CreateStage(stageName, project.LastBuildStatus, project.Activity, project.LastBuildTime));
                }
            }

            return results;
        }
示例#15
0
        public void santized_name_should_remove_dots_from_name()
        {
            var displayablePipeline = new DisplayablePipeline("A.Name.With.Dots", null);

            Assert.That(displayablePipeline.SanitizedName, Is.EqualTo("ANameWithDots"));
        }
        public void SetsStyleWidth()
        {
            var displayablePipeline = new DisplayablePipeline("Name", null)
                {
                    Stages = new List<IStage>
                        {
                            new PassedStage("Stage 1", null, "2000-01-01"),
                            new PassedStage("Stage 2", null, "2000-01-01")
                        }
                };

            Assert.That(displayablePipeline.PipelineStageWidth, Is.EqualTo(48));
        }
        public void should_truncate_last_build_label_if_more_than_15_characters()
        {
            var displayablePipeline = new DisplayablePipeline("Name", "1234567890123456")
                {
                    Stages = new List<IStage>
                        {
                            new PassedStage("Stage 1", null, "2000-01-01")
                        }
                };

            Assert.That(displayablePipeline.ProcessedLastBuildLabel, Is.EqualTo("123456789012345…"));
        }
        public void santized_name_should_remove_dots_from_name()
        {
            var displayablePipeline = new DisplayablePipeline("A.Name.With.Dots", null);

            Assert.That(displayablePipeline.SanitizedName, Is.EqualTo("ANameWithDots"));
        }