public void TestInvalidNamesAreNormalized() { var output = new TestValidationWriter(); var identifierWithDot = "bla.xml"; var identifierWithDash = "t-1"; var visitor = new DotBuilderVisitor(identifierWithDot, output); visitor.PreVisit(new BuildScriptGraph(new[] { new BuildScript(identifierWithDot) })); var target = new Target(identifierWithDash, ""); visitor.PreVisit(target); visitor.Visit(new TargetDependency(target)); output.AssertNotContains(identifierWithDot); output.AssertNotContains(identifierWithDash); }
private void AssertDotContents(string resourcePath, string target, string name, Action<TestValidationWriter, Stream> asserter) { var repository = FileSystemRepository.ForPath(ResourcesPath); var buildScript = Parser.Parse(repository, resourcePath, target); var output = new TestValidationWriter(); var visitor = new DotBuilderVisitor(name, output); buildScript.Accept(visitor); asserter(output, repository[resourcePath]); }