public void ConvertTreeQueryToQueryHandlesMoreThanOneDisplayField()
        {
            // Arrange
            Mock <ITfsQuery> treeQuery = new Mock <ITfsQuery>();

            treeQuery.Setup(q => q.DisplayFieldList).Returns(TestHelper.CreateMockFieldDefinitions("[System.Id]", "[System.Title]"));

            // Act
            string convertedQueryString = QueryUtilities.ConvertTreeQueryToQueryForItem(treeQuery.Object);

            // Assert
            Assert.AreEqual <string>("SELECT [System.Id], [System.Title] FROM WorkItems", convertedQueryString, "Multiple fields not being handled correctly");
        }
        public void ConvertTreeQueryToQueryForItemConstructsAQueryStringFromWorkItems()
        {
            // Arrange
            // select [System.Id] from WorkItemLinks
            Mock <ITfsQuery> treeQuery = new Mock <ITfsQuery>();

            treeQuery.Setup(q => q.DisplayFieldList).Returns(TestHelper.CreateMockFieldDefinitions("[System.Id]"));

            // Act
            string convertedQueryString = QueryUtilities.ConvertTreeQueryToQueryForItem(treeQuery.Object);

            // Assert
            Assert.AreEqual <string>("SELECT [System.Id] FROM WorkItems", convertedQueryString);
        }
 public void ConvertTreeQueryToQueryForItemTestsArgumentForNull()
 {
     TestHelper.TestForArgumentNullException(() => QueryUtilities.ConvertTreeQueryToQueryForItem(null), "query");
 }