Esempio n. 1
0
        public void GetDefectFieldsReturnsValidResponse()
        {
            // Arrange
            IV1ItemTypeFields v1ItemTypeFields = new V1ItemTypeFields();

            // Act
            var response = v1ItemTypeFields.GetDefectFields();

            // Assert
            Assert.IsNotNull(response);
            Assert.AreEqual(response.Count, 17);
        }
Esempio n. 2
0
        public Query BuildDefectQuery(string projectName)
        {
            Query query = null;

            if (!string.IsNullOrEmpty(projectName) && _assetType != null)
            {
                query = new Query(_assetType);

                //Since we need to get a specific Story or Stories that meet some criteria, we set up a filter
                FilterTerm term = new FilterTerm(_assetType.GetAttributeDefinition(SCOPENAME));
                term.Equal(projectName);
                query.Filter = term;

                //Add them to the query object since we need to get these specific attributes
                V1ItemTypeFields fieldNames = new V1ItemTypeFields();

                foreach (string fieldName in fieldNames.GetDefectFields())
                {
                    query.Selection.Add(_assetType.GetAttributeDefinition(fieldName));
                }
            }

            return(query);
        }