public Parse ( System.Xml.Linq.XElement data, |
||
data | System.Xml.Linq.XElement | |
buildProject | ||
Результат | void |
public void ShouldParseTarget() { var subject = new CscParser(); subject.Parse(XElement.Parse(_input.ToString()), null); Assert.That(subject.Target, Is.EqualTo("library")); }
public void ShouldParseReferences() { var subject = new CscParser(); subject.Parse(XElement.Parse(_input.ToString()), null); Assert.That(subject.References[0], Is.EqualTo("${thirdparty.windsor}")); Assert.That(subject.References[1], Is.EqualTo("${thirdparty.castlecore}")); }
public void ShouldParseOutput() { var subject = new CscParser(); subject.Parse(XElement.Parse(_input.ToString()), null); Assert.That(subject.Output, Is.EqualTo("${assembly.output}")); }
public void ShouldGenerateStringWithComments() { var subject = new CscParser(); var data = XElement.Parse(_input.ToString()); subject.Parse(data, null); var expectedString = new StringBuilder(); foreach (var line in data.ToString().Split('\n')) { expectedString.AppendLine("//" + line); } expectedString.AppendLine(); expectedString.AppendLine("var sourceFiles = new Fileset()"); expectedString.AppendLine("\t.Include(${dir.commons}).RecurseAllSubDirectories.Filter(\"*.cs\")"); expectedString.AppendLine("\t.Exclude(${dir.commons}).RecurseAllSubDirectories.Filter(\"AssemblyInfo.cs\")"); expectedString.AppendLine("\t.Include(${dir.compile}).Filter(\"CommonAssemblyInfo.cs\");"); expectedString.AppendLine(); expectedString.AppendLine("FluentBuild.Core.Build.UsingCsc.Target.Library"); expectedString.AppendLine("\t.AddSources(sourceFiles)"); expectedString.AppendLine("\t.AddRefences(${thirdparty.windsor}, ${thirdparty.castlecore})"); expectedString.AppendLine("\t.OutputFileTo(${assembly.output})"); expectedString.AppendLine("\t.Execute();"); var generatedData = subject.GererateString().Split('\n'); var actualData = expectedString.ToString().Split('\n'); for (int i = 0; i < generatedData.Length; i++) { if (actualData.Length < i) Assert.Fail("actual data was smaller than expected"); Assert.That(generatedData[i], Is.EqualTo(actualData[i])); } }
public void ShouldParseReferences() { var subject = new CscParser(); subject.Parse(XElement.Parse(_input.ToString()), null); Assert.That(subject.References[0], Is.EqualTo("${thirdparty.windsor}")); Assert.That(subject.References[1], Is.EqualTo("${thirdparty.castlecore}")); }
public void ShouldGenerateStringWithComments() { var subject = new CscParser(); var data = XElement.Parse(_input.ToString()); subject.Parse(data, null); var expectedString = new StringBuilder(); foreach (var line in data.ToString().Split('\n')) { expectedString.AppendLine("//" + line); } expectedString.AppendLine(); expectedString.AppendLine("var sourceFiles = new Fileset()"); expectedString.AppendLine("\t.Include(${dir.commons}).RecurseAllSubDirectories.Filter(\"*.cs\")"); expectedString.AppendLine("\t.Exclude(${dir.commons}).RecurseAllSubDirectories.Filter(\"AssemblyInfo.cs\")"); expectedString.AppendLine("\t.Include(${dir.compile}).Filter(\"CommonAssemblyInfo.cs\");"); expectedString.AppendLine(); expectedString.AppendLine("FluentBuild.Core.Build.UsingCsc.Target.Library"); expectedString.AppendLine("\t.AddSources(sourceFiles)"); expectedString.AppendLine("\t.AddRefences(${thirdparty.windsor}, ${thirdparty.castlecore})"); expectedString.AppendLine("\t.OutputFileTo(${assembly.output})"); expectedString.AppendLine("\t.Execute();"); var generatedData = subject.GererateString().Split('\n'); var actualData = expectedString.ToString().Split('\n'); for (int i = 0; i < generatedData.Length; i++) { if (actualData.Length < i) { Assert.Fail("actual data was smaller than expected"); } Assert.That(generatedData[i], Is.EqualTo(actualData[i])); } }
public void ShouldParseTarget() { var subject = new CscParser(); subject.Parse(XElement.Parse(_input.ToString()), null); Assert.That(subject.Target, Is.EqualTo("library")); }
public void ShouldParseOutput() { var subject = new CscParser(); subject.Parse(XElement.Parse(_input.ToString()), null); Assert.That(subject.Output, Is.EqualTo("${assembly.output}")); }