private static void AssertHasTarget(
Package fooPkg,
string expectedTargetName)
{
string expectedTargetLocation = Path.Combine(
SourcePath(),
fooPkg.Name + "/lib/" + expectedTargetName);
Assert.IsNotNull(fooPkg.TargetLibs);
var target = fooPkg.TargetLibs.FirstOrDefault(
l => l.Name == expectedTargetName);
Assert.IsTrue(
target != null
&& AreEquivalentPaths(
expectedTargetLocation,
target.FolderLocation),
string.Format(
"Expected target : {0}\n" +
"Expected location: {1}\n" +
"Actual target: {2}\n" +
"Actual location: {3}",
Path.GetFullPath(expectedTargetName),
Path.GetFullPath(expectedTargetLocation),
target != null ? target.Name : "<Target Not Found>",
target != null ? target.FolderLocation : "<Target Not Found>"));
}