本文整理汇总了C#中AutoTest.Core.Caching.Projects.ProjectDocument类的典型用法代码示例。如果您正苦于以下问题:C# ProjectDocument类的具体用法?C# ProjectDocument怎么用?C# ProjectDocument使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProjectDocument类属于AutoTest.Core.Caching.Projects命名空间,在下文中一共展示了ProjectDocument类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Should_build_the_command_line_for_each_run
public void Should_build_the_command_line_for_each_run()
{
_configuration
.Stub(x => x.MSpecTestRunner("framework 1"))
.Return("c:\\runner 1.exe");
_configuration
.Stub(x => x.MSpecTestRunner("framework 2"))
.Return("c:\\runner 2.exe");
_fileSystem
.Stub(x => x.FileExists(null))
.IgnoreArguments()
.Return(true);
var document1 = new ProjectDocument(ProjectType.CSharp);
document1.SetFramework("framework 1");
var info1 = new TestRunInfo(new Project("key 1", document1), "assembly 1");
var document2 = new ProjectDocument(ProjectType.CSharp);
document2.SetFramework("framework 2");
var info2 = new TestRunInfo(new Project("key 2", document2), "assembly 2");
var testRunInfos = new[] { info1, info2 };
_runner.RunTests(testRunInfos, null);
_commandLineBuilder.AssertWasCalled(x => x.Build(null),
o => o.IgnoreArguments().Repeat.Twice());
}
示例2: Should_add_exists_referencedby_records
public void Should_add_exists_referencedby_records()
{
var existingDocument = new ProjectDocument(ProjectType.CSharp);
existingDocument.AddReferencedBy("someproject");
var document = _parser.Parse(getCSharpProject(), existingDocument);
document.ReferencedBy[0].ShouldEqual("someproject");
}
示例3: Should_get_product_version_spesific_build_executable
public void Should_get_product_version_spesific_build_executable()
{
var document = new ProjectDocument(ProjectType.CSharp);
document.SetFramework("v3.5");
document.SetVSVersion("9.0.30729");
_config.BuildExecutable(document).ShouldEqual(@"C:\ProductVersionFolder\MSBuild.exe");
}
示例4: setDefaultNamespace
private void setDefaultNamespace(ProjectDocument newDocument)
{
var ns = _xml.SelectSingleNode("b:Project/b:PropertyGroup/b:RootNamespace", _nsManager);
if (ns == null)
throw new Exception("Could not read root namespace. Invalid project file.");
newDocument.SetDefaultNamespace(ns.InnerText);
}
示例5: SetUp
public void SetUp()
{
var document = new ProjectDocument(ProjectType.CSharp);
document.AddReference("ReferencedProject");
var parser = new FakeProjectParser(new ProjectDocument[] {document});
_cache = new FakeCache();
_preparer = new ProjectPreparer(parser, _cache);
}
示例6: When_already_prepared_return_null
public void When_already_prepared_return_null()
{
var document = new ProjectDocument(ProjectType.CSharp);
document.HasBeenReadFromFile();
var record = new Project("someproject", document);
var project = _preparer.Prepare(record);
project.ShouldBeTheSameAs(record);
}
示例7: setAssembly
private void setAssembly(ProjectDocument newDocument)
{
var assemblyName = getNode(ASSEMBLYNAME_NODE);
var fileType = getNode(OUTPUT_TYPE).ToLower();
if (!fileType.Equals("exe"))
fileType = "dll";
newDocument.SetAssemblyName(string.Format("{0}.{1}", assemblyName, fileType));
}
示例8: Should_add_exists_referencedby_records
public void Should_add_exists_referencedby_records()
{
_config.Stub(x => x.ProjectsToIgnore).Return(new string[] {});
var existingDocument = new ProjectDocument(ProjectType.CSharp);
existingDocument.AddReferencedBy("someproject");
var document = _parser.Parse(getCSharpProject(), existingDocument);
document.ReferencedBy[0].ShouldEqual("someproject");
}
示例9: When_custom_output_path_use_custom_output_path
public void When_custom_output_path_use_custom_output_path()
{
var document = new ProjectDocument(ProjectType.CSharp);
document.SetAssemblyName("mehassembly.dll");
document.SetOutputPath(string.Format("bin{0}Debug", Path.DirectorySeparatorChar));
var project = new Project(string.Format("C:{0}Project{0}Location{0}meh.csproj", Path.DirectorySeparatorChar), document);
var assembly = project.GetAssembly(string.Format("bin{0}bleh{0}", Path.DirectorySeparatorChar));
assembly.ShouldEqual(string.Format(@"C:{0}Project{0}Location{0}bin{0}bleh{0}mehassembly.dll", Path.DirectorySeparatorChar));
}
示例10: SetUp
public void SetUp()
{
_firstDocument = new ProjectDocument(ProjectType.CSharp);
_firstDocument.HasBeenReadFromFile();
_secondDocument = new ProjectDocument(ProjectType.CSharp);
_secondDocument.HasBeenReadFromFile();
var parser = new FakeProjectParser(new ProjectDocument[] { _secondDocument, _firstDocument });
_cache = new Cache(new FakeServiceLocator(parser, delegate { return _cache; }));
}
示例11: SetUp
public void SetUp()
{
var document = new ProjectDocument(ProjectType.CSharp);
document.AddReference("ReferencedProject");
var parser = new FakeProjectParser(new ProjectDocument[] {document});
_cache = new FakeCache();
_preparer = new ProjectPreparer(parser, _cache);
_testProject = Path.GetFullPath(string.Format("TestResources{0}VS2008{0}CSharpNUnitTestProject.csproj", Path.DirectorySeparatorChar));
}
示例12: When_custom_output_path_exists_use_only_custom_output_path
public void When_custom_output_path_exists_use_only_custom_output_path()
{
var path = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath);
var document = new ProjectDocument(ProjectType.CSharp);
document.SetAssemblyName("mehassembly.dll");
document.SetOutputPath(string.Format("bin{0}Debug", Path.DirectorySeparatorChar));
var project = new Project(string.Format("C:{0}Project{0}Location{0}meh.csproj", Path.DirectorySeparatorChar), document);
var assembly = project.GetAssembly(path);
assembly.ShouldEqual(string.Format(Path.Combine(path, "mehassembly.dll"), Path.DirectorySeparatorChar));
}
示例13: Should_populate_referenced_by
public void Should_populate_referenced_by()
{
var record = new Project("someproject", null);
var referencedProject = new ProjectDocument(ProjectType.CSharp);
_cache.WhenGeting("ReferencedProject")
.Return(new Project("", referencedProject));
var project = _preparer.Prepare(record);
project.ShouldNotBeNull();
referencedProject.ReferencedBy[0].ShouldEqual("someproject");
}
示例14: SetUp
public void SetUp()
{
_firstDocument = new ProjectDocument(ProjectType.CSharp);
_firstDocument.HasBeenReadFromFile();
_secondDocument = new ProjectDocument(ProjectType.CSharp);
_secondDocument.HasBeenReadFromFile();
var parser = new FakeProjectParser(new ProjectDocument[] { _secondDocument, _firstDocument });
_cache = new Cache(new FakeServiceLocator(parser, delegate { return _cache; }));
_testProject = Path.GetFullPath(string.Format("TestResources{0}VS2008{0}CSharpNUnitTestProject.csproj", Path.DirectorySeparatorChar));
_testProjectVB = Path.GetFullPath(string.Format("TestResources{0}VS2008{0}NUnitTestProjectVisualBasic.vbproj", Path.DirectorySeparatorChar));
}
示例15: setAssembly
private void setAssembly(ProjectDocument newDocument)
{
var assemblyName = getNode(ASSEMBLYNAME_NODE);
if (assemblyName.Length == 0)
throw new Exception("Could not read assembly name. Invalid project file.");
var fileType = getNode(OUTPUT_TYPE).ToLower();
if (fileType.Contains("exe"))
fileType = "exe";
else
fileType = "dll";
newDocument.SetAssemblyName(string.Format("{0}.{1}", assemblyName, fileType));
}