本文整理汇总了C#中AutoTest.Core.Caching.Projects.ProjectDocument.SetAssemblyName方法的典型用法代码示例。如果您正苦于以下问题:C# ProjectDocument.SetAssemblyName方法的具体用法?C# ProjectDocument.SetAssemblyName怎么用?C# ProjectDocument.SetAssemblyName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AutoTest.Core.Caching.Projects.ProjectDocument
的用法示例。
在下文中一共展示了ProjectDocument.SetAssemblyName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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));
}
示例2: 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));
}
示例3: 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));
}
示例4: 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));
}
示例5: 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));
}
示例6: SetUp
public void SetUp()
{
// Project dependency graph
//
// Project2
// /
//Project0 Project5
// \ /
// Project6
// \
//Project1 Project4
// \ /
// Project3
//
_projectList = new string[]
{
string.Format("Proj0{0}Project0.csproj", Path.DirectorySeparatorChar),
string.Format("Proj1{0}Project1.csproj", Path.DirectorySeparatorChar),
string.Format("Proj2{0}Project2.csproj", Path.DirectorySeparatorChar),
string.Format("Proj3{0}Project3.csproj", Path.DirectorySeparatorChar),
string.Format("Proj4{0}Project4.csproj", Path.DirectorySeparatorChar),
string.Format("Proj5{0}Project5.csproj", Path.DirectorySeparatorChar),
string.Format("Proj6{0}Project6.csproj", Path.DirectorySeparatorChar)
};
_cache = MockRepository.GenerateMock<ICache>();
var document = new ProjectDocument(ProjectType.CSharp);
document.AddReferencedBy(new string[] { _projectList[2], _projectList[6] });
document.SetAssemblyName("Project0.dll");
document.SetOutputPath(string.Format("bin{0}Debug", Path.DirectorySeparatorChar));
_cache.Stub(c => c.Get<Project>(_projectList[0])).Return(new Project(_projectList[0], document));
document = new ProjectDocument(ProjectType.CSharp);
document.AddReferencedBy(_projectList[3]);
document.SetAssemblyName("Project1.dll");
document.SetOutputPath(string.Format("bin{0}Debug", Path.DirectorySeparatorChar));
document.RebuildOnNextRun();
_cache.Stub(c => c.Get<Project>(_projectList[1])).Return(new Project(_projectList[1], document));
document = new ProjectDocument(ProjectType.CSharp);
document.AddReference(_projectList[0]);
document.SetAssemblyName("Project2.dll");
document.SetOutputPath(string.Format("bin{0}Debug", Path.DirectorySeparatorChar));
_cache.Stub(c => c.Get<Project>(_projectList[2])).Return(new Project(_projectList[2], document));
document = new ProjectDocument(ProjectType.CSharp);
document.AddReference(_projectList[1]);
document.AddReferencedBy(_projectList[4]);
document.SetAssemblyName("Project3.dll");
document.SetOutputPath(string.Format("bin{0}Debug", Path.DirectorySeparatorChar));
_cache.Stub(c => c.Get<Project>(_projectList[3])).Return(new Project(_projectList[3], document));
document = new ProjectDocument(ProjectType.CSharp);
document.AddReference(new string[] { _projectList[6], _projectList[3] });
document.SetAssemblyName("Project4.dll");
document.SetOutputPath(string.Format("bin{0}Debug", Path.DirectorySeparatorChar));
_cache.Stub(c => c.Get<Project>(_projectList[4])).Return(new Project(_projectList[4], document));
document = new ProjectDocument(ProjectType.CSharp);
document.AddReference(_projectList[6]);
document.SetAssemblyName("Project5.dll");
document.SetOutputPath(string.Format("bin{0}Debug", Path.DirectorySeparatorChar));
document.RebuildOnNextRun();
_cache.Stub(c => c.Get<Project>(_projectList[5])).Return(new Project(_projectList[5], document));
document = new ProjectDocument(ProjectType.CSharp);
document.AddReference(_projectList[0]);
document.AddReferencedBy(new string[] { _projectList[4], _projectList[5] });
document.SetAssemblyName("Project6.dll");
document.SetOutputPath(string.Format("bin{0}Debug", Path.DirectorySeparatorChar));
_cache.Stub(c => c.Get<Project>(_projectList[6])).Return(new Project(_projectList[6], document));
_optimizer = new BuildOptimizer(_cache, MockRepository.GenerateMock<IConfiguration>());
}