public void GetUsingTaskCondition_SetInXml() { Project p = new Project(); p.LoadXml(TestData.ContentUsingTaskName); Assertion.AssertEquals("true", CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p.UsingTasks).Condition); }
public void GetConditionExpression() { Project p = new Project(); p.LoadXml(TestData.ContentUsingTaskFile); Assertion.AssertEquals("$(value)==true", CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p.UsingTasks).Condition); }
public void GetAssemblyNameScalarThatIsNotSet() { Project p = new Project(new Engine()); p.AddNewUsingTaskFromAssemblyName("TaskName", @"$(assemblyName)"); object o = p.EvaluatedItems; Assertion.AssertEquals(@"$(assemblyName)", CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p.UsingTasks).AssemblyName); }
public void GetAssemblyNameSpecialChars() { Project p = new Project(); p.AddNewUsingTaskFromAssemblyName("TaskName", @"%*?@$();\"); object o = p.EvaluatedItems; Assertion.AssertEquals(@"%*?@$();\", CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p.UsingTasks).AssemblyName); }
public void GetAssemblyNameSpecialCharsEscaped() { Project p = new Project(new Engine()); p.AddNewUsingTaskFromAssemblyName("TaskName", @"%25%2a%3f%40%24%28%29%3b\"); object o = p.EvaluatedItems; Assertion.AssertEquals(@"%25%2a%3f%40%24%28%29%3b\", CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p.UsingTasks).AssemblyName); }
public void GetConditionSimple() { Project p = new Project(); p.LoadXml(TestData.ContentUsingTaskName); object o = p.EvaluatedProperties; Assertion.AssertEquals("true", CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p.UsingTasks).Condition); }
public void GetTaskNameSpeicalCharsEscaped() { Project p = new Project(new Engine()); p.AddNewUsingTaskFromAssemblyName(@"%25%2a%3f%40%24%28%29%3b\", "assemblyName"); object o = p.EvaluatedItems; Assertion.AssertNotNull(CompatibilityTestHelpers.FindUsingTaskByName(@"%25%2a%3f%40%24%28%29%3b\", p.UsingTasks)); }
public void IsImported_false() { Project p = new Project(new Engine()); p.LoadXml(TestData.ContentUsingTaskFile); object o = p.EvaluatedProperties; Assertion.AssertEquals(false, CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p.UsingTasks).IsImported); }
public void GetTaskNameSpeicalChars() { Project p = new Project(); p.AddNewUsingTaskFromAssemblyName(@"%*?@$();\", "assemblyName"); object o = p.EvaluatedItems; Assertion.AssertNotNull(CompatibilityTestHelpers.FindUsingTaskByName(@"%*?@$();\", p.UsingTasks)); }
public void GetTaskName_SetInXml() { Project p = new Project(); p.LoadXml(TestData.ContentUsingTaskFile); object o = p.EvaluatedItems; Assertion.AssertNotNull(CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p.UsingTasks)); }
public void GetUsingTaskAssemblyFile_SetInXml() { Project p = new Project(new Engine()); p.LoadXml(TestData.ContentUsingTaskFile); object o = p.EvaluatedItems; Assertion.AssertEquals("AssemblyName.dll", CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p.UsingTasks).AssemblyFile); }
/// <summary> /// Set an assembly file name, then retrieve it. /// </summary> private string SetandGetAssemblyFileName(string assemblyFileName) { Project p = new Project(); p.AddNewUsingTaskFromAssemblyFile("TaskName", assemblyFileName); object o = p.EvaluatedItems; UsingTask usingTask = CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p.UsingTasks); return(usingTask.AssemblyFile); }
public void GetTaskNameScalar() { Project p = new Project(new Engine()); p.AddNewUsingTaskFromAssemblyName("$(name)", "assemblyName"); p.SetProperty("name", "TaskName"); object o = p.EvaluatedItems; Assertion.AssertNotNull(CompatibilityTestHelpers.FindUsingTaskByName("$(name)", p.UsingTasks)); }
public void GetAssemblyNameScalarEvaluation() { string assemblyName = "$(assemblyName)"; Project p = new Project(); p.SetProperty("assemblyName", "aName"); object o = p.EvaluatedItems; p.AddNewUsingTaskFromAssemblyName("TaskName", assemblyName); o = p.EvaluatedItems; Assertion.AssertEquals(assemblyName, CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p.UsingTasks).AssemblyName); }
public void IsImported_true() { string importPath = String.Empty; try { importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.ContentUsingTaskName); Project p = new Project(new Engine()); p.AddNewImport(importPath, "true"); Object o = p.EvaluatedProperties; Import import = CompatibilityTestHelpers.FindFirstMatchingImportByPath(p.Imports, importPath); import.Condition = null; Assertion.AssertEquals(true, CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p.UsingTasks).IsImported); } finally { CompatibilityTestHelpers.RemoveFile(importPath); } }
public void ImportsUsingTask() { string importPath = String.Empty; try { importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.Content3SimpleTargetsDefaultSpecified); Project p = new Project(); p.Save(importPath); // required to reproduce importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.ContentUsingTaskFile); Project p2 = new Project(); // new Engine() here fixes testcase p2.AddNewImport(importPath, "true"); object o = p2.EvaluatedProperties; // evaluate the import Assertion.AssertNull(CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p2.UsingTasks)); // fails to find task } finally { CompatibilityTestHelpers.RemoveFile(importPath); } }