예제 #1
0
 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)))]"));
 }
예제 #2
0
        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()); }
        }
예제 #3
0
 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)))]"));
 }
예제 #4
0
 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))]"));
 }