public void ExistsWhenImportedTargetAndParentTargetHaveSameName() { string importProjectContents = @" <Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> <Target Name='t1'> <Message Text='imported.t2.task' /> </Target> </Project> "; string parentProjectContents = @" <Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> <Target Name='t1'> <Message Text='parent.t1.task' /> </Target> <Target Name='t2' /> <Import Project='import.proj' /> </Project> "; Project p = GetProjectThatImportsAnotherProject(importProjectContents, parentProjectContents); TargetCollection targets = p.Targets; Assertion.AssertEquals(true, targets.Exists("t1")); }
public void ExistsOfImportedTarget() { Project p = GetProjectThatImportsAnotherProject(null, null); TargetCollection targets = p.Targets; Assertion.AssertEquals(true, targets.Exists("t4")); }
public void ExistsWhenTargetDoesNotExist() { project.LoadXml(ProjectContentSeveralTargets); TargetCollection targets = project.Targets; Assertion.AssertEquals(false, targets.Exists("tNot")); }
public void ExistsWhenTargetExists() { project.LoadXml(ProjectContentSeveralTargets); TargetCollection targets = project.Targets; Assertion.AssertEquals(true, targets.Exists("t2")); }
public void RemoveTargetOfExistingTarget() { project.LoadXml(ProjectContentSeveralTargets); TargetCollection targets = project.Targets; targets.RemoveTarget(GetSpecificTargetFromProject(project, "t1")); Assertion.AssertEquals(false, targets.Exists("t1")); }
public void AddNewTargetWhenNoOtherTargetsExist() { project.LoadXml(ProjectContentNoTargets); TargetCollection targets = project.Targets; targets.AddNewTarget("t"); Assertion.AssertEquals(true, targets.Exists("t")); Assertion.AssertEquals(1, targets.Count); }
public void AddNewTargetWhenTargetOfSameNameAlreadyExists() { project.LoadXml(ProjectContentSeveralTargets); TargetCollection targets = project.Targets; targets.AddNewTarget("t1"); Assertion.AssertEquals(true, targets.Exists("t1")); Assertion.AssertEquals(5, targets.Count); }
public void AddNewTargetSimple() { project.LoadXml(ProjectContentSeveralTargets); TargetCollection targets = project.Targets; targets.AddNewTarget("tNew"); Assertion.AssertEquals(true, targets.Exists("tNew")); Assertion.AssertEquals(6, targets.Count); }