|
|
|
|
@ -2,6 +2,9 @@
@@ -2,6 +2,9 @@
|
|
|
|
|
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
|
|
|
|
|
|
|
|
|
using System; |
|
|
|
|
using System.Collections; |
|
|
|
|
using System.Collections.Generic; |
|
|
|
|
using System.Linq; |
|
|
|
|
using ICSharpCode.PackageManagement.EnvDTE; |
|
|
|
|
using NUnit.Framework; |
|
|
|
|
using PackageManagement.Tests.Helpers; |
|
|
|
|
@ -27,6 +30,17 @@ namespace PackageManagement.Tests.EnvDTE
@@ -27,6 +30,17 @@ namespace PackageManagement.Tests.EnvDTE
|
|
|
|
|
properties = projectItem.Properties; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AssertContainsProperty(string propertyName, IEnumerable items) |
|
|
|
|
{ |
|
|
|
|
var itemsList = new List<Property>(); |
|
|
|
|
foreach (Property property in items) { |
|
|
|
|
itemsList.Add(property); |
|
|
|
|
} |
|
|
|
|
var matchedProperty = itemsList.Find(p => p.Name == propertyName); |
|
|
|
|
|
|
|
|
|
Assert.AreEqual(propertyName, matchedProperty.Name); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void Value_GetCopyToOutputDirectoryPropertyValue_ReturnsCopyToOutputDirectoryValueFromMSBuildProject() |
|
|
|
|
{ |
|
|
|
|
@ -76,5 +90,27 @@ namespace PackageManagement.Tests.EnvDTE
@@ -76,5 +90,27 @@ namespace PackageManagement.Tests.EnvDTE
|
|
|
|
|
|
|
|
|
|
Assert.IsTrue(saved); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void GetEnumerator_FindCopyToOutputDirectoryPropertyInAllProperties_ReturnsPropertyWithCopyToOutputDirectoryName() |
|
|
|
|
{ |
|
|
|
|
CreateProjectItemProperties(); |
|
|
|
|
|
|
|
|
|
var projectItemProperties = new List<Property>(properties); |
|
|
|
|
var property = projectItemProperties.Find(p => p.Name == "CopyToOutputDirectory"); |
|
|
|
|
|
|
|
|
|
Assert.AreEqual("CopyToOutputDirectory", property.Name); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void GetEnumerator_FindCopyToOutputDirectoryPropertyFromUntypedEnumerator_ReturnsPropertyWithCopyToOutputDirectoryName() |
|
|
|
|
{ |
|
|
|
|
CreateProjectItemProperties(); |
|
|
|
|
|
|
|
|
|
var projectItemProperties = properties as IEnumerable; |
|
|
|
|
|
|
|
|
|
AssertContainsProperty("CopyToOutputDirectory", projectItemProperties); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|