Esempio n. 1
0
        public void Can_Initialize_New_IdNameReference()
        {
            //Act
            var ttf = new IdNameReference(10);

            //Assert
            Assert.That(ttf, Is.Not.Null);
        }
Esempio n. 2
0
        public void ToString_Returns_Correct_Value_With_Name()
        {
            //Arrange
            var ttf = new IdNameReference("foo");

            //Act
            var ttfStr = ttf.ToString();

            //Assert
            Assert.That(ttfStr, Is.EqualTo("\"foo\""));
            Console.WriteLine(ttfStr);
        }
Esempio n. 3
0
        public void ToString_Returns_Correct_Value_With_Multiple_DefIds()
        {
            //Arrange
            var ttf = new IdNameReference(10, 16, 30);

            //Act
            var ttfStr = ttf.ToString();

            //Assert
            Assert.That(ttfStr, Is.EqualTo("#10, #16, #30"));
            Console.WriteLine(ttfStr);
        }
        private ReleaseDefinition CreateReleaseDefinition(Models.Releases.ReleaseDefinition releaseDefinition)
        {
            var dto = new ReleaseDefinition
            {
                Name = releaseDefinition.name,
                Id   = releaseDefinition.id
            };

            Artifact artifact = releaseDefinition.artifacts?.FirstOrDefault(x => x.isPrimary);

            if (artifact?.definitionReference?.project != null)
            {
                IdNameReference projectId = artifact.definitionReference.project;
                dto.Project = projectRepository.GetProject(projectId.id);
            }

            return(dto);
        }
Esempio n. 5
0
        public AqlSearchRequest Build()
        {
            IdNameReference objectTypeToFind = null;

            if (!string.IsNullOrEmpty(this.ObjectTypeName))
            {
                objectTypeToFind = new IdNameReference(this.ObjectTypeName);
            }

            if (this.ObjectTypeIds != null && this.ObjectTypeIds.Count > 0)
            {
                objectTypeToFind = new IdNameReference(this.ObjectTypeIds);
            }

            var searchControl =
                this.SearchControlBuilder != null
                    ? this.SearchControlBuilder.Build()
                    : null;

            return(new AqlSearchRequest(this.Path, this.RequestFilters, this.SelectedAqlQueryType, objectTypeToFind, this.Query, searchControl));
        }
        internal AqlSearchRequest(string basePath, ISearchRequestFilter[] requestFilters, AqlQueryTypes aqlQueryType, IdNameReference typeToFind, string queryString, SearchControl searchControl)
        {
            this.BasePath       = basePath;
            this.QueryType      = aqlQueryType.GetStringValue();
            this.QueryString    = queryString;
            this.SearchControl  = searchControl;
            this.RequestFilters = requestFilters;

            if (typeToFind != null)
            {
                this.ObjectTypeToFind = typeToFind.ToString();
            }
        }
 internal AqlSearchRequest(string basePath, AqlQueryTypes aqlQueryType, IdNameReference typeToFind, string queryString, SearchControl searchControl)
     : this(
         basePath, null, aqlQueryType, typeToFind, queryString, searchControl
         )
 {
 }