本文整理汇总了C#中IProject.GetComponent方法的典型用法代码示例。如果您正苦于以下问题:C# IProject.GetComponent方法的具体用法?C# IProject.GetComponent怎么用?C# IProject.GetComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IProject
的用法示例。
在下文中一共展示了IProject.GetComponent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoTest
protected override void DoTest(IProject project)
{
var languageLevelProjectProperty = project.GetComponent<CSharpLanguageLevelProjectProperty>();
languageLevelProjectProperty.ExecuteWithLanguageLevel(project, CSharpLanguageLevel.CSharp50, () =>
{
base.DoTest(project);
});
}
示例2: GetUnitTestElements
protected override ICollection<IUnitTestElement> GetUnitTestElements(IProject testProject, string assemblyLocation)
{
var elements = base.GetUnitTestElements(testProject, assemblyLocation).ToList();
var services = testProject.GetComponent<XunitServiceProvider>();
var unitTestElementFactory = new UnitTestElementFactory(services, null);
var theoryElement = unitTestElementFactory.GetOrCreateTestTheory(testProject,
(XunitTestMethodElement) elements[1], "TestMethod(value: 42)");
elements.Add(theoryElement);
return elements;
}
示例3: GetUnitTestElements
protected override ICollection<IUnitTestElement> GetUnitTestElements(IProject testProject, string assemblyLocation)
{
var elements = base.GetUnitTestElements(testProject, assemblyLocation).ToList();
var element = elements.Single(e => e.ShortName == "HasRunWith") as XunitTestClassElement;
var services = testProject.GetComponent<XunitServiceProvider>();
var unitTestElementFactory = new UnitTestElementFactory(services, null);
var theoryElement = unitTestElementFactory.GetOrCreateTestMethod(testProject,
element, element.TypeName, "TestMethodWithExistingTask",
string.Empty, new OneToSetMap<string, string>(), isDynamic: true);
elements.Add(theoryElement);
return elements;
}
开发者ID:Booksbaum,项目名称:resharper-xunit,代码行数:13,代码来源:When_class_with_runwith_attribute_runs_again_xunit1.cs