170 references to GetFirst
Microsoft.Build.Engine.OM.UnitTests (169)
Construction\ConstructionEditing_Tests.cs (14)
1348Assert.Equal(target1, Helpers.GetFirst(project.Children)); 1372Assert.Equal(target2, Helpers.GetFirst(project.Children)); 1429Assert.Equal(target2, Helpers.GetFirst(project.Children)); 1540Assert.Equal(propertyGroup, Helpers.GetFirst(project.Children)); 1789Assert.Equal(item, Helpers.GetFirst(Helpers.GetFirst(project.ItemGroups).Items)); 2015Assert.Equal(itemDefinition, Helpers.GetFirst(Helpers.GetFirst(project.ItemDefinitionGroups).ItemDefinitions)); 2085Assert.Equal(last, Helpers.GetLast(Helpers.GetFirst(project.ItemDefinitionGroups).ItemDefinitions)); 2130Assert.Equal(property, Helpers.GetFirst(Helpers.GetFirst(project.PropertyGroups).Properties)); 2325ProjectItem item = Helpers.GetFirst(project.Items); 2353ProjectMetadata metadatum = Helpers.GetFirst(project.Items).GetMetadata("m"); 2360metadatum = Helpers.GetFirst(project.Items).GetMetadata("m");
Construction\ProjectChooseElement_Tests.cs (6)
178ProjectChooseElement choose = (ProjectChooseElement)Helpers.GetFirst(project.Children); 180Assert.Null(Helpers.GetFirst(choose.Children)); 198ProjectChooseElement choose = (ProjectChooseElement)Helpers.GetFirst(project.Children); 222ProjectChooseElement choose = (ProjectChooseElement)Helpers.GetFirst(project.Children); 276ProjectChooseElement choose = Helpers.GetFirst(project.Xml.ChooseElements); 277ProjectWhenElement when = Helpers.GetFirst(choose.WhenElements);
Construction\ProjectExtensionsElement_Tests.cs (6)
36ProjectExtensionsElement extensions = (ProjectExtensionsElement)Helpers.GetFirst(project.Children); 122ProjectExtensionsElement extensions = (ProjectExtensionsElement)Helpers.GetFirst(project.Children); 148ProjectExtensionsElement extensions = (ProjectExtensionsElement)Helpers.GetFirst(project.Children); 174ProjectExtensionsElement extensions = (ProjectExtensionsElement)Helpers.GetFirst(project.Children); 197ProjectExtensionsElement extensions = (ProjectExtensionsElement)Helpers.GetFirst(project.Children); 216ProjectExtensionsElement extensions = (ProjectExtensionsElement)Helpers.GetFirst(project.Children);
Construction\ProjectImportElement_Tests.cs (4)
124ProjectImportElement import = (ProjectImportElement)Helpers.GetFirst(project.Children); 146ProjectImportElement import = (ProjectImportElement)Helpers.GetFirst(project.Children); 180ProjectImportElement import = Helpers.GetFirst(project.Xml.Imports); 219ProjectImportElement import = Helpers.GetFirst(project.Xml.Imports);
Construction\ProjectImportGroupElement_Tests.cs (7)
167ProjectImportGroupElement importGroup = (ProjectImportGroupElement)Helpers.GetFirst(project.ImportGroups); 331ProjectImportGroupElement importGroup = (ProjectImportGroupElement)Helpers.GetFirst(project.Children); 333ProjectImportElement import = (ProjectImportElement)Helpers.GetFirst(importGroup.Imports); 358ProjectImportGroupElement importGroup = (ProjectImportGroupElement)Helpers.GetFirst(project.Children); 360ProjectImportElement import = (ProjectImportElement)Helpers.GetFirst(importGroup.Imports); 375ProjectImportGroupElement importGroup = Helpers.GetFirst(project.ImportGroups); 392ProjectImportGroupElement importGroup = Helpers.GetFirst(project.ImportGroups);
Construction\ProjectItemDefinitionElement_Tests.cs (8)
36ProjectItemDefinitionGroupElement itemDefinitionGroup = (ProjectItemDefinitionGroupElement)Helpers.GetFirst(project.Children); 37ProjectItemDefinitionElement itemDefinition = Helpers.GetFirst(itemDefinitionGroup.ItemDefinitions); 60ProjectItemDefinitionGroupElement itemDefinitionGroup = (ProjectItemDefinitionGroupElement)Helpers.GetFirst(project.Children); 61ProjectItemDefinitionElement definition = Helpers.GetFirst(itemDefinitionGroup.ItemDefinitions); 65Assert.Equal("m1", Helpers.GetFirst(definition.Metadata).Name); 66Assert.Equal("v1", Helpers.GetFirst(definition.Metadata).Value); 109ProjectItemDefinitionGroupElement itemDefinitionGroup = (ProjectItemDefinitionGroupElement)Helpers.GetFirst(project.Children); 110ProjectItemDefinitionElement itemDefinition = Helpers.GetFirst(itemDefinitionGroup.ItemDefinitions);
Construction\ProjectItemDefinitionGroupElement_Tests.cs (3)
61ProjectItemDefinitionGroupElement itemDefinitionGroup = (ProjectItemDefinitionGroupElement)Helpers.GetFirst(project.Children); 105ProjectItemDefinitionGroupElement itemDefinitionGroup = Helpers.GetFirst(project.ItemDefinitionGroups); 122ProjectItemDefinitionGroupElement itemDefinitionGroup = Helpers.GetFirst(project.ItemDefinitionGroups);
Construction\ProjectItemElement_Tests.cs (3)
413ProjectItemElement item = Helpers.GetFirst(itemGroup.Items); 980Assert.Equal("i2", Helpers.GetFirst(project.Items).EvaluatedInclude); 1044return Helpers.GetFirst(project.Items);
Construction\ProjectItemGroupElement_tests.cs (4)
44ProjectItemGroupElement group = (ProjectItemGroupElement)Helpers.GetFirst(project.Children); 66ProjectItemGroupElement group = (ProjectItemGroupElement)Helpers.GetFirst(project.Children); 85ProjectItemGroupElement itemGroup = Helpers.GetFirst(project.ItemGroups); 102ProjectItemGroupElement itemGroup = Helpers.GetFirst(project.ItemGroups);
Construction\ProjectMetadataElement_Tests.cs (3)
1271ProjectItemGroupElement itemGroup = (ProjectItemGroupElement)Helpers.GetFirst(project.Children); 1272ProjectItemElement item = Helpers.GetFirst(itemGroup.Items); 1273ProjectMetadataElement metadata = Helpers.GetFirst(item.Metadata);
Construction\ProjectOnErrorElement_Tests.cs (7)
51ProjectTargetElement target = (ProjectTargetElement)Helpers.GetFirst(project.Children); 81ProjectTargetElement target = (ProjectTargetElement)Helpers.GetFirst(project.Children); 82ProjectOnErrorElement onError = (ProjectOnErrorElement)Helpers.GetFirst(target.Children); 107ProjectTargetElement target = (ProjectTargetElement)Helpers.GetFirst(project.Children); 108ProjectOnErrorElement onError = (ProjectOnErrorElement)Helpers.GetFirst(target.Children); 303ProjectTargetElement target = (ProjectTargetElement)Helpers.GetFirst(project.Children); 304ProjectOnErrorElement onError = (ProjectOnErrorElement)Helpers.GetFirst(target.Children);
Construction\ProjectOutputElement_Tests.cs (6)
292ProjectTargetElement target = (ProjectTargetElement)Helpers.GetFirst(project.Children); 293ProjectTaskElement task = (ProjectTaskElement)Helpers.GetFirst(target.Children); 294return Helpers.GetFirst(task.Outputs); 315ProjectTargetElement target = (ProjectTargetElement)Helpers.GetFirst(project.Children); 316ProjectTaskElement task = (ProjectTaskElement)Helpers.GetFirst(target.Children); 317return Helpers.GetFirst(task.Outputs);
Construction\ProjectPropertyElement_Tests.cs (4)
49ProjectPropertyGroupElement propertyGroup = (ProjectPropertyGroupElement)Helpers.GetFirst(project.Children); 50ProjectPropertyElement property = Helpers.GetFirst(propertyGroup.Properties); 280ProjectPropertyGroupElement propertyGroup = (ProjectPropertyGroupElement)Helpers.GetFirst(project.Children); 281ProjectPropertyElement property = Helpers.GetFirst(propertyGroup.Properties);
Construction\ProjectPropertyGroupElement_Tests.cs (4)
43ProjectPropertyGroupElement group = (ProjectPropertyGroupElement)Helpers.GetFirst(project.Children); 65ProjectPropertyGroupElement group = (ProjectPropertyGroupElement)Helpers.GetFirst(project.Children); 83ProjectPropertyGroupElement propertyGroup = Helpers.GetFirst(project.PropertyGroups); 100ProjectPropertyGroupElement propertyGroup = Helpers.GetFirst(project.PropertyGroups);
Construction\ProjectTargetElement_Tests.cs (2)
61ProjectTargetElement target = (ProjectTargetElement)Helpers.GetFirst(project.Children); 385ProjectTargetElement target = (ProjectTargetElement)Helpers.GetFirst(project.Children);
Construction\ProjectTaskElement_Tests.cs (2)
304ProjectTargetElement target = (ProjectTargetElement)Helpers.GetFirst(project.Children); 305return (ProjectTaskElement)Helpers.GetFirst(target.Children);
Construction\ProjectUsingTaskElement_Tests.cs (6)
422ProjectUsingTaskElement usingTask = (ProjectUsingTaskElement)Helpers.GetFirst(project.Children); 446Helpers.GetFirst(project.Children); 467Helpers.GetFirst(project.Children); 484ProjectUsingTaskElement usingTask = (ProjectUsingTaskElement)Helpers.GetFirst(project.Children); 502ProjectUsingTaskElement usingTask = (ProjectUsingTaskElement)Helpers.GetFirst(project.Children); 519ProjectUsingTaskElement usingTask = (ProjectUsingTaskElement)Helpers.GetFirst(project.Children);
Construction\UsingTaskBodyElement_Tests.cs (1)
140ProjectUsingTaskElement usingTask = (ProjectUsingTaskElement)Helpers.GetFirst(project.Children);
Construction\UsingTaskParameterElement_Tests.cs (2)
229ProjectUsingTaskElement usingTask = (ProjectUsingTaskElement)Helpers.GetFirst(project.Children); 231ProjectUsingTaskParameterElement body = Helpers.GetFirst(parameterGroup.Parameters);
Construction\UsingTaskParameterGroup_Tests.cs (1)
141ProjectUsingTaskElement usingTask = (ProjectUsingTaskElement)Helpers.GetFirst(project.Children);
Definition\DefinitionEditing_Tests.cs (35)
167Assert.Equal("i1", Helpers.GetFirst(project.GetItems("i")).EvaluatedInclude); 194Assert.Equal("i(1)", Helpers.GetFirst(project.GetItems("i")).EvaluatedInclude); 271Assert.Equal("$(p)", Helpers.GetFirst(project.Items).UnevaluatedInclude); 272Assert.Equal("v1", Helpers.GetFirst(project.Items).EvaluatedInclude); 677Helpers.GetFirst(project.GetItems("i")).SetMetadataValue("n", "n1"); 722Helpers.GetFirst(project.GetItems("i")).SetMetadataValue("m", "m2"); 762ProjectMetadata metadatum = Helpers.GetFirst(project.GetItems("i")).GetMetadata("m"); 798Helpers.GetFirst(project.GetItems("i")).RemoveMetadata("m"); 888ProjectItem item = Helpers.GetFirst(project.Items); 898ProjectItemElement newItemElement = Helpers.GetFirst((Helpers.GetFirst(project.Xml.ItemGroups)).Items); 1002ProjectItem item = Helpers.GetFirst(project.GetItems("i")); 1102ProjectItem item = Helpers.GetFirst(project.Items); 1144ProjectItem item = Helpers.GetFirst(project.Items); 1174ProjectItem item = Helpers.GetFirst(project.GetItems("i")); 1188ProjectItemGroupElement itemGroupElement = Helpers.GetFirst(project.Xml.ItemGroups); 1198Assert.True(object.ReferenceEquals(item, Helpers.GetFirst(project.GetItems("j")))); 1199Assert.True(object.ReferenceEquals(item, Helpers.GetFirst(project.GetItemsIgnoringCondition("j")))); 1200Assert.True(object.ReferenceEquals(item, Helpers.GetFirst(project.GetItemsByEvaluatedInclude("i1")))); 1218ProjectItem item = Helpers.GetFirst(project.GetItems("i")); 1236ProjectItemElement itemElement = Helpers.GetFirst(Helpers.GetFirst(project.Xml.ItemGroups).Items); 1269ProjectItem item = Helpers.GetFirst(project.GetItems("i")); 1282ProjectItemGroupElement itemGroupElement = Helpers.GetFirst(project.Xml.ItemGroups); 1285Assert.True(object.ReferenceEquals(itemGroupElement, Helpers.GetFirst(project.GetItems("i")).Xml.Parent)); 1306project.RemoveItem(Helpers.GetFirst(project.GetItems("i"))); 1337project.RemoveItem(Helpers.GetFirst(project.GetItems("i"))); 1365project.RemoveItem(Helpers.GetFirst(project.GetItems("i"))); 1398ProjectItem item = Helpers.GetFirst(project.Items); 2011ProjectItem item = Helpers.GetFirst(project.Items); 2032item = Helpers.GetFirst(project.Items); 2091Assert.Equal("i1", Helpers.GetFirst(project.GetItems("i")).EvaluatedInclude); 2118Assert.Equal("i(1)", Helpers.GetFirst(project.GetItems("i")).EvaluatedInclude); 2195Assert.Equal("$(p)", Helpers.GetFirst(project.Items).UnevaluatedInclude); 2196Assert.Equal("v1", Helpers.GetFirst(project.Items).EvaluatedInclude);
Definition\Project_Tests.cs (4)
2222ProjectItem itemToRemove = Helpers.GetFirst(project.GetItems("Compile")); 2244ProjectItem itemToRemove = Helpers.GetFirst(project.GetItems("Compile")); 2511Helpers.GetFirst(items).UnevaluatedInclude.ShouldBe(unevaluatedInclude); 2512Helpers.GetFirst(items).EvaluatedInclude.ShouldBe(evaluatedInclude);
Definition\ProjectItem_Tests.cs (7)
164ProjectItem item = Helpers.GetFirst(project.GetItems("i")); 1895ProjectItem item = Helpers.GetFirst(project.GetItems("i")); 1919ProjectItem item = Helpers.GetFirst(project.GetItems("i")); 1951ProjectItem item = Helpers.GetFirst(project.GetItems("i")); 2067ProjectItem item = Helpers.GetFirst(project.GetItems("i")); 2098ProjectItem item = Helpers.GetFirst(project.GetItems("i")); 2130item = Helpers.GetFirst(project.GetItems("i"));
Definition\ProjectItemDefinition_Tests.cs (1)
70Assert.Equal("v", Helpers.GetFirst(project.GetItems("i")).GetMetadataValue("m"));
Definition\ProjectMetadata_Tests.cs (11)
60Helpers.GetFirst(project.GetItems("i")).SetMetadataValue("m1", "v2"); 61Helpers.GetFirst(project.GetItems("i")).SetMetadataValue("m2", "v%214"); 80Assert.Equal("v!4", Helpers.GetFirst(project.GetItems("i")).GetMetadataValue("m2")); 162ProjectMetadata metadatum = Helpers.GetFirst(project.GetItems("j")).GetMetadata("m1"); 189ProjectMetadata metadatum = Helpers.GetFirst(project.GetItems("i")).GetMetadata("m1"); 215ProjectMetadata metadatum = Helpers.GetFirst(project.GetItems("i")).GetMetadata("m1"); 242ProjectMetadata metadatum = Helpers.GetFirst(project.GetItems("i")).GetMetadata("m1"); 274ProjectMetadata metadatum = Helpers.GetFirst(project.GetItems("i")).GetMetadata("m1"); 306ProjectMetadata metadatum = Helpers.GetFirst(project.GetItems("i")).GetMetadata("m1"); 338ProjectMetadata metadatum = Helpers.GetFirst(project.GetItems("i")).GetMetadata("m1"); 469ProjectItem item = Helpers.GetFirst(project.GetItems("i"));
Instance\ProjectInstance_Tests.cs (18)
693Helpers.VerifyAssertThrowsInvalidOperation(delegate () { instance.RemoveItem(Helpers.GetFirst(instance.Items)); }); 737Helpers.VerifyAssertThrowsInvalidOperation(delegate () { Helpers.GetFirst(instance.Items).EvaluatedInclude = "x"; }); 748Helpers.VerifyAssertThrowsInvalidOperation(delegate () { ((ITaskItem2)Helpers.GetFirst(instance.Items)).EvaluatedIncludeEscaped = "x"; }); 759Helpers.VerifyAssertThrowsInvalidOperation(delegate () { ((ITaskItem2)Helpers.GetFirst(instance.Items)).ItemSpec = "x"; }); 770Helpers.VerifyAssertThrowsInvalidOperation(delegate () { ((ITaskItem2)Helpers.GetFirst(instance.Items)).SetMetadataValueLiteral("a", "b"); }); 781Helpers.VerifyAssertThrowsInvalidOperation(delegate () { Helpers.GetFirst(instance.Items).SetMetadata(new List<KeyValuePair<string, string>>()); }); 792Helpers.VerifyAssertThrowsInvalidOperation(delegate () { Helpers.GetFirst(instance.Items).SetMetadata("a", "b"); }); 803Helpers.VerifyAssertThrowsInvalidOperation(delegate () { Helpers.GetFirst(instance.Items).RemoveMetadata("n"); }); 814Helpers.VerifyAssertThrowsInvalidOperation(delegate () { Helpers.GetFirst(instance.Properties).EvaluatedValue = "v2"; }); 875Helpers.GetFirst(instance.Items).EvaluatedInclude = "new"; 898Helpers.VerifyAssertThrowsInvalidOperation(delegate () { Helpers.GetFirst(instance.Properties).EvaluatedValue = "v2"; }); 899Helpers.VerifyAssertThrowsInvalidOperation(delegate () { Helpers.GetFirst(instance.Items).EvaluatedInclude = "new"; }); 923Helpers.VerifyAssertThrowsInvalidOperation(delegate () { Helpers.GetFirst(instance.Properties).EvaluatedValue = "v2"; }); 924Helpers.VerifyAssertThrowsInvalidOperation(delegate () { Helpers.GetFirst(instance.Items).EvaluatedInclude = "new"; }); 945Helpers.VerifyAssertThrowsInvalidOperation(delegate () { Helpers.GetFirst(instance.Properties).EvaluatedValue = "v2"; }); 946Helpers.VerifyAssertThrowsInvalidOperation(delegate () { Helpers.GetFirst(instance.Items).EvaluatedInclude = "new"; }); 963Helpers.GetFirst(instance.Items).EvaluatedInclude = "new"; 980Helpers.GetFirst(instance.Items).EvaluatedInclude = "new";
Microsoft.Build.Engine.UnitTests (1)
Evaluation\Evaluator_Tests.cs (1)
1429Assert.Equal("3", (Helpers.GetFirst(instance.Targets["t"].Tasks)).GetParameter("Text"));