Assert.AreEqual ("no", project.GetEvaluatedProperty ("Exists"), "A1");
}
+
+ [Test]
+ public void EmptyExistsCondition()
+ {
+ string documentString = @"
+ <Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
+ <Choose>
+ <When Condition=""Exists('$(UndefinedProperty)')"">
+ <PropertyGroup>
+ <Exists>yes</Exists>
+ </PropertyGroup>
+ </When>
+ <Otherwise>
+ <PropertyGroup>
+ <Exists>no</Exists>
+ </PropertyGroup>
+ </Otherwise>
+ </Choose>
+ </Project>
+ ";
+
+ Engine engine = new Engine (Consts.BinPath);
+ Project project = engine.CreateNewProject ();
+ //assign a real filename to be used as base path for the Exists
+ project.FullFileName = typeof (BuildChooseTest).Assembly.Location;
+
+ project.LoadXml (documentString);
+
+ Assert.AreEqual ("no", project.GetEvaluatedProperty ("Exists"), "A1");
+ }
}
}