public void parseTest3() { var target = new MSBuildComponent(Loader); Assert.AreEqual(Value.Empty, target.parse("[$(vParseTest3 = \"string123\")]")); Assert.AreEqual(" left 'string123' ) right ", target.parse("[$([System.String]::Format(\" left '{0}' ) right \", $(vParseTest3)))]")); Assert.AreEqual(" left \"string123\" ) right ", target.parse("[$([System.String]::Format(' left \"{0}\" ) right ', $(vParseTest3)))]")); }
public void parseTest2() { var target = new MSBuildComponent(Loader); try { target.parse("[$()]"); Assert.Fail("1"); } catch(Exception ex) { Assert.IsTrue(ex.GetType() == typeof(SyntaxIncorrectException), ex.GetType().ToString()); } try { target.parse("[$(]"); Assert.Fail("2"); } catch(Exception ex) { Assert.IsTrue(ex.GetType() == typeof(SyntaxIncorrectException), ex.GetType().ToString()); } try { target.parse("[$(notRealVariablename]"); Assert.Fail("3"); } catch(Exception ex) { Assert.IsTrue(ex.GetType() == typeof(SyntaxIncorrectException), ex.GetType().ToString()); } }
public void parseTest4() { var target = new MSBuildComponent(Loader); Assert.AreEqual("$(name)", target.parse("[$$(name)]")); Assert.AreEqual("$$(name)", target.parse("[$$$(name)]")); Assert.AreEqual("$([System.String]::Format(\" left '{0}' ) right \", $(name)))", target.parse("[$$([System.String]::Format(\" left '{0}' ) right \", $(name)))]")); }
public void parseTest1() { var target = new MSBuildComponent(Loader); Assert.AreEqual(vsCE.MSBuild.Parser.PROP_VALUE_DEFAULT, target.parse("[$(notRealVariablename)]")); Assert.AreEqual("65536", target.parse("[$([System.Math]::Pow(2, 16))]")); }