示例#1
0
文件: Import_Tests.cs 项目: 3F/IeXod
        public void ProjectPathSet_ScalarValue()
        {
            string importPath  = String.Empty;
            string importPath2 = String.Empty;

            try
            {
                importPath  = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.Content3SimpleTargetsDefaultSpecified);
                importPath2 = ObjectModelHelpers.CreateFileInTempProjectDirectory("import2.proj", TestData.Content3SimpleTargetsDefaultSpecified);
                Project p = new Project();
                p.AddNewImport(importPath, "true");
                p.SetProperty("path", importPath2);
                object        o      = p.EvaluatedProperties;
                BuildProperty path   = CompatibilityTestHelpers.FindBuildProperty(p, "path");
                Import        import = CompatibilityTestHelpers.FindFirstMatchingImportByPath(p.Imports, importPath);
                import.ProjectPath = "$(path)";
                Assertion.AssertEquals("$(path)", import.ProjectPath);
                o = p.EvaluatedProperties;
                Assertion.AssertEquals(false, object.Equals(importPath2, import.EvaluatedProjectPath)); // V9 OM does not evaluate imports
            }
            finally
            {
                CompatibilityTestHelpers.RemoveFile(importPath);
                CompatibilityTestHelpers.RemoveFile(importPath2);
            }
        }
示例#2
0
        public void ToolsetScalar()
        {
            Project p = new Project();

            p.SetProperty("version", "number");
            BuildProperty versionProperty = CompatibilityTestHelpers.FindBuildProperty(p, "version");

            p.ParentEngine.Toolsets.Add(new Toolset("scalar", @"$(version)"));
            object o = p.EvaluatedProperties;

            Assertion.AssertEquals(false, Object.Equals(versionProperty.Value, p.ParentEngine.Toolsets["scalar"].ToolsVersion));
        }