public void Contains_WithExistentProperty_ShouldReturnTrue() { string inputValue = "<PropertyGroup><Test>Content</Test></PropertyGroup>"; MsBuildXmlPropertyGroupImplementation propertyGroupImplementation = new MsBuildXmlPropertyGroupImplementation(CreateFromString(inputValue)); IMsBuildProperty property = propertyGroupImplementation.First(); Assert.IsTrue(propertyGroupImplementation.Contains(property)); }
Load_FromExistentTestFileWithTargetImplementingComplexConditionalOverwritableProperty_ShouldReturnProjectContainingTargetWithOverwritableProperty() { IMsBuildProject projectFile = MsBuildProjectFile.Load("TestData/ProjectFiles/TargetWithProperties.tcsproj"); IMsBuildTarget target = projectFile.GetChildren <IMsBuildTarget>() .First(t => t.Name.Equals("WithComplexConditionalOverwritableProperty")); IMsBuildProperty overwritableProperty = target.GetChildren <IMsBuildPropertyGroup>().First().GetChildren <IMsBuildProperty>() .First(p => p.Name.Equals("OverwritableProperty")); Assert.AreEqual(true, overwritableProperty.HasPublicSetter); }
public void CopyTo_Array_ShouldCopyAllValuesToArray() { string inputValue = "<PropertyGroup></PropertyGroup>"; IMsBuildProperty[] array = new IMsBuildProperty[20]; MsBuildXmlPropertyGroupImplementation propertyGroupImplementation = new MsBuildXmlPropertyGroupImplementation(CreateFromString(inputValue)); for (int i = 0; i <= 10; i++) { Mock <IMsBuildProperty> mock = new Mock <IMsBuildProperty>(); mock.Setup(m => m.Value).Returns($"OverwrittenContent{i}"); mock.Setup(m => m.Name).Returns($"OverwrittenTest{i}"); propertyGroupImplementation.Add(mock.Object); } propertyGroupImplementation.CopyTo(array, 0); Assert.AreEqual("OverwrittenContent0", array[0].Value); }
public void Insert(int index, IMsBuildProperty item) { _properties.Insert(index, item); }
public int IndexOf(IMsBuildProperty item) { return(_properties.IndexOf(item)); }
public bool Remove(IMsBuildProperty item) { return(_properties.Remove(item)); }
public bool Contains(IMsBuildProperty item) { return(_properties.Contains(item)); }
public void Add(IMsBuildProperty item) { _properties.Add(item); }