本文整理汇总了C#中AutoTest.Core.Caching.Projects.ProjectDocument类的典型用法代码示例。如果您正苦于以下问题:C# ProjectDocument类的具体用法?C# ProjectDocument怎么用?C# ProjectDocument使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProjectDocument类属于AutoTest.Core.Caching.Projects命名空间,在下文中一共展示了ProjectDocument类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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());
}
开发者ID:jeremywiebe,项目名称:AutoTest.Net,代码行数:30,代码来源:MSpecTestRunnerTest.cs
示例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");
}
开发者ID:rlarno,项目名称:AutoTest.Net,代码行数:7,代码来源:ProjectParserTest.cs
示例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");
}
开发者ID:JamesTryand,项目名称:AutoTest.Net,代码行数:7,代码来源:ConfigTest.cs
示例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);
}
开发者ID:noamkfir,项目名称:AutoTest.Net,代码行数:7,代码来源:ProjectParser.cs
示例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);
}
开发者ID:nieve,项目名称:AutoTest.Net,代码行数:8,代码来源:ProjectPreparerTest.cs
示例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);
}
开发者ID:tonyx,项目名称:AutoTest.Net,代码行数:8,代码来源:ProjectPreparerTest.cs
示例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));
}
开发者ID:nieve,项目名称:AutoTest.Net,代码行数:8,代码来源:ProjectParser.cs
示例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");
}
开发者ID:Vernathic,项目名称:ic-AutoTest.NET4CTDD,代码行数:8,代码来源:ProjectParserTest.cs
示例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));
}
开发者ID:roelofb,项目名称:AutoTest.Net,代码行数:9,代码来源:ProjectTest.cs
示例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; }));
}
开发者ID:nieve,项目名称:AutoTest.Net,代码行数:9,代码来源:CacheTest.cs
示例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));
}
开发者ID:tonyx,项目名称:AutoTest.Net,代码行数:9,代码来源:ProjectPreparerTest.cs
示例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));
}
开发者ID:roelofb,项目名称:AutoTest.Net,代码行数:10,代码来源:ProjectTest.cs
示例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");
}
开发者ID:tonyx,项目名称:AutoTest.Net,代码行数:10,代码来源:ProjectPreparerTest.cs
示例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));
}
开发者ID:tonyx,项目名称:AutoTest.Net,代码行数:11,代码来源:CacheTest.cs
示例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));
}
开发者ID:tonyx,项目名称:AutoTest.Net,代码行数:12,代码来源:ProjectParser.cs
示例16: Should_report_the_time_info
public void Should_report_the_time_info()
{
var document = new ProjectDocument(ProjectType.CSharp);
document.SetFramework("framework 1");
var info = new TestRunInfo(new Project("key 1", document), "assembly 1");
var infos = new[] { info };
var run = new MSpecTestRunner.Run { RunInfos = infos };
var args = _builder.Build(run);
Assert.That(args, Is.StringContaining("--timeinfo"));
}
开发者ID:Vernathic,项目名称:ic-AutoTest.NET4CTDD,代码行数:13,代码来源:MSpecCommandLineBuilderTest.cs
示例17: setAssembly
private void setAssembly(ProjectDocument newDocument)
{
var assemblyName = _xml.SelectSingleNode("b:Project/b:PropertyGroup/b:AssemblyName", _nsManager);
if (assemblyName == null)
throw new Exception("Could not read assembly name. Invalid project file.");
var outputType = _xml.SelectSingleNode("b:Project/b:PropertyGroup/b:OutputType", _nsManager); ;
if (outputType == null)
throw new Exception("Could not read output type. Invalid project file.");
string fileType = "dll";
if (outputType.InnerText.ToLower().Contains("exe"))
fileType = "exe";
newDocument.SetAssemblyName(string.Format("{0}.{1}", assemblyName.InnerText, fileType));
}
开发者ID:noamkfir,项目名称:AutoTest.Net,代码行数:13,代码来源:ProjectParser.cs
示例18: Should_create_the_assembly_list
public void Should_create_the_assembly_list()
{
var document = new ProjectDocument(ProjectType.CSharp);
document.SetFramework("framework 1");
var info1 = new TestRunInfo(new Project("key 1", document), "assembly 1");
var info2 = new TestRunInfo(new Project("key 2", document), "assembly 2");
var infos = new[] { info1, info2 };
var run = new MSpecTestRunner.Run { RunInfos = infos };
var args = _builder.Build(run);
Assert.That(args, Is.StringContaining(" \"assembly 1\""));
Assert.That(args, Is.StringContaining(" \"assembly 2\""));
}
开发者ID:Vernathic,项目名称:ic-AutoTest.NET4CTDD,代码行数:15,代码来源:MSpecCommandLineBuilderTest.cs
示例19: Should_create_the_assembly_list_from_distinct_assembly_names
public void Should_create_the_assembly_list_from_distinct_assembly_names()
{
var document = new ProjectDocument(ProjectType.CSharp);
document.SetFramework("framework 1");
var info1 = new TestRunInfo(new Project("key 1", document), "assembly 1");
var info2 = new TestRunInfo(new Project("key 2", document), "assembly 1");
var infos = new[] { info1, info2 };
var run = new MSpecTestRunner.Run { RunInfos = infos };
var args = _builder.Build(run);
var assembly1Count = new Regex("assembly 1").Matches(args).Count;
Assert.That(assembly1Count, Is.EqualTo(1));
}
开发者ID:Vernathic,项目名称:ic-AutoTest.NET4CTDD,代码行数:15,代码来源:MSpecCommandLineBuilderTest.cs
示例20: Should_create_an_xml_report
public void Should_create_an_xml_report()
{
var document = new ProjectDocument(ProjectType.CSharp);
document.SetFramework("framework 1");
var info = new TestRunInfo(new Project("key 1", document), "assembly 1");
var infos = new[] { info };
var run = new MSpecTestRunner.Run { RunInfos = infos };
var args = _builder.Build(run);
Assert.That(args, Is.StringContaining("--xml"));
Assert.That(run.Cleanups.Count(), Is.EqualTo(1));
Assert.That(run.Harvesters.Count(), Is.EqualTo(1));
}
开发者ID:Vernathic,项目名称:ic-AutoTest.NET4CTDD,代码行数:15,代码来源:MSpecCommandLineBuilderTest.cs
注:本文中的AutoTest.Core.Caching.Projects.ProjectDocument类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论