本文整理汇总了C#中ISourceInformationProvider类的典型用法代码示例。如果您正苦于以下问题:C# ISourceInformationProvider类的具体用法?C# ISourceInformationProvider怎么用?C# ISourceInformationProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISourceInformationProvider类属于命名空间,在下文中一共展示了ISourceInformationProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: XunitTestFrameworkDiscoverer
/// <summary>
/// Initializes a new instance of the <see cref="XunitTestFrameworkDiscoverer"/> class.
/// </summary>
/// <param name="assemblyInfo">The test assembly.</param>
/// <param name="sourceProvider">The source information provider.</param>
public XunitTestFrameworkDiscoverer(IAssemblyInfo assemblyInfo, ISourceInformationProvider sourceProvider = null)
{
Guard.ArgumentNotNull("assemblyInfo", assemblyInfo);
this.assemblyInfo = assemblyInfo;
this.sourceProvider = sourceProvider ?? new VisualStudioSourceInformationProvider();
}
示例2: BrowserTestFrameworkExecutor
/// <summary>
/// Initializes a new instance of the <see cref="T:Xunit.Sdk.XunitTestFrameworkExecutor"/> class.
/// </summary>
/// <param name="assemblyName">Name of the test assembly.</param><param name="sourceInformationProvider">The source line number information provider.</param><param name="diagnosticMessageSink">The message sink to report diagnostic messages to.</param>
public BrowserTestFrameworkExecutor(
AssemblyName assemblyName,
ISourceInformationProvider sourceInformationProvider,
IMessageSink diagnosticMessageSink)
: base(assemblyName, sourceInformationProvider, diagnosticMessageSink)
{
}
示例3: KuduXunitTestFrameworkDiscoverer
public KuduXunitTestFrameworkDiscoverer(IAssemblyInfo assemblyInfo,
ISourceInformationProvider sourceProvider,
IMessageSink diagnosticMessageSink,
IXunitTestCollectionFactory collectionFactory = null)
: base(assemblyInfo, sourceProvider, diagnosticMessageSink, collectionFactory)
{
}
示例4: Xunit2Discoverer
Xunit2Discoverer(AppDomainSupport appDomainSupport,
ISourceInformationProvider sourceInformationProvider,
IAssemblyInfo assemblyInfo,
string assemblyFileName,
string xunitExecutionAssemblyPath,
string configFileName,
bool shadowCopy,
string shadowCopyFolder,
IMessageSink diagnosticMessageSink,
bool verifyAssembliesOnDisk)
{
Guard.ArgumentNotNull("assemblyInfo", (object)assemblyInfo ?? assemblyFileName);
if (verifyAssembliesOnDisk)
Guard.FileExists("xunitExecutionAssemblyPath", xunitExecutionAssemblyPath);
#if PLATFORM_DOTNET
CanUseAppDomains = false;
#else
CanUseAppDomains = !IsDotNet(xunitExecutionAssemblyPath);
#endif
DiagnosticMessageSink = diagnosticMessageSink ?? new NullMessageSink();
var appDomainAssembly = assemblyFileName ?? xunitExecutionAssemblyPath;
appDomain = AppDomainManagerFactory.Create(appDomainSupport != AppDomainSupport.Denied && CanUseAppDomains, appDomainAssembly, configFileName, shadowCopy, shadowCopyFolder);
var testFrameworkAssemblyName = GetTestFrameworkAssemblyName(xunitExecutionAssemblyPath);
// If we didn't get an assemblyInfo object, we can leverage the reflection-based IAssemblyInfo wrapper
if (assemblyInfo == null)
assemblyInfo = appDomain.CreateObject<IAssemblyInfo>(testFrameworkAssemblyName, "Xunit.Sdk.ReflectionAssemblyInfo", assemblyFileName);
framework = appDomain.CreateObject<ITestFramework>(testFrameworkAssemblyName, "Xunit.Sdk.TestFrameworkProxy", assemblyInfo, sourceInformationProvider, DiagnosticMessageSink);
discoverer = Framework.GetDiscoverer(assemblyInfo);
}
示例5: Xunit2Discoverer
// Used by Xunit2 when initializing for both discovery and execution.
internal Xunit2Discoverer(ISourceInformationProvider sourceInformationProvider,
string assemblyFileName,
string configFileName,
bool shadowCopy,
string shadowCopyFolder = null,
IMessageSink diagnosticMessageSink = null)
: this(sourceInformationProvider, null, assemblyFileName, GetXunitExecutionAssemblyPath(assemblyFileName), configFileName, shadowCopy, shadowCopyFolder, diagnosticMessageSink) { }
示例6: XunitFrontController
/// <summary>
/// Initializes a new instance of the <see cref="XunitFrontController"/> class.
/// </summary>
/// <param name="appDomainSupport">Determines whether tests should be run in a separate app domain.</param>
/// <param name="assemblyFileName">The test assembly.</param>
/// <param name="configFileName">The test assembly configuration file.</param>
/// <param name="shadowCopy">If set to <c>true</c>, runs tests in a shadow copied app domain, which allows
/// tests to be discovered and run without locking assembly files on disk.</param>
/// <param name="shadowCopyFolder">The path on disk to use for shadow copying; if <c>null</c>, a folder
/// will be automatically (randomly) generated</param>
/// <param name="sourceInformationProvider">The source information provider. If <c>null</c>, uses the default (<see cref="T:Xunit.VisualStudioSourceInformationProvider"/>).</param>
/// <param name="diagnosticMessageSink">The message sink which received <see cref="IDiagnosticMessage"/> messages.</param>
public XunitFrontController(AppDomainSupport appDomainSupport,
string assemblyFileName,
string configFileName = null,
bool shadowCopy = true,
string shadowCopyFolder = null,
ISourceInformationProvider sourceInformationProvider = null,
IMessageSink diagnosticMessageSink = null)
{
this.appDomainSupport = appDomainSupport;
this.assemblyFileName = assemblyFileName;
this.configFileName = configFileName;
this.shadowCopy = shadowCopy;
this.shadowCopyFolder = shadowCopyFolder;
this.sourceInformationProvider = sourceInformationProvider;
this.diagnosticMessageSink = diagnosticMessageSink ?? new NullMessageSink();
Guard.FileExists("assemblyFileName", assemblyFileName);
if (this.sourceInformationProvider == null)
{
#if NETSTANDARD1_1
this.sourceInformationProvider = new NullSourceInformationProvider();
#else
this.sourceInformationProvider = new VisualStudioSourceInformationProvider(assemblyFileName);
#endif
toDispose.Push(this.sourceInformationProvider);
}
}
示例7: XunitFrontController
/// <summary>
/// Initializes a new instance of the <see cref="XunitFrontController"/> class.
/// </summary>
/// <param name="assemblyFileName">The test assembly.</param>
/// <param name="configFileName">The test assembly configuration file.</param>
/// <param name="shadowCopy">If set to <c>true</c>, runs tests in a shadow copied app domain, which allows
/// <param name="shadowCopyFolder">The path on disk to use for shadow copying; if <c>null</c>, a folder
/// will be automatically (randomly) generated</param>
/// <param name="sourceInformationProvider">The source information provider. If <c>null</c>, uses the default (<see cref="T:Xunit.VisualStudioSourceInformationProvider"/>).</param>
/// tests to be discovered and run without locking assembly files on disk.</param>
/// <param name="diagnosticMessageSink">The message sink which received <see cref="IDiagnosticMessage"/> messages.</param>
public XunitFrontController(string assemblyFileName,
string configFileName = null,
bool shadowCopy = true,
string shadowCopyFolder = null,
ISourceInformationProvider sourceInformationProvider = null,
IMessageSink diagnosticMessageSink = null)
{
this.assemblyFileName = assemblyFileName;
this.configFileName = configFileName;
this.shadowCopy = shadowCopy;
this.shadowCopyFolder = shadowCopyFolder;
this.sourceInformationProvider = sourceInformationProvider;
this.diagnosticMessageSink = diagnosticMessageSink ?? new NullMessageSink();
Guard.FileExists("assemblyFileName", assemblyFileName);
if (this.sourceInformationProvider == null)
{
#if !XAMARIN && !WINDOWS_PHONE_APP && !WINDOWS_PHONE && !ASPNET50 && !ASPNETCORE50
this.sourceInformationProvider = new VisualStudioSourceInformationProvider(assemblyFileName);
#else
this.sourceInformationProvider = new NullSourceInformationProvider();
#endif
toDispose.Push(this.sourceInformationProvider);
}
}
示例8: Xunit2Discoverer
Xunit2Discoverer(ISourceInformationProvider sourceInformationProvider,
IAssemblyInfo assemblyInfo,
string assemblyFileName,
string xunitExecutionAssemblyPath,
string configFileName,
bool shadowCopy,
string shadowCopyFolder)
{
Guard.ArgumentNotNull("assemblyInfo", (object)assemblyInfo ?? assemblyFileName);
#if !ANDROID
Guard.ArgumentValid("xunitExecutionAssemblyPath", "File not found: " + xunitExecutionAssemblyPath, File.Exists(xunitExecutionAssemblyPath));
#endif
appDomain = new RemoteAppDomainManager(assemblyFileName ?? xunitExecutionAssemblyPath, configFileName, shadowCopy, shadowCopyFolder);
#if !ANDROID
var name = AssemblyName.GetAssemblyName(xunitExecutionAssemblyPath);
var testFrameworkAssemblyName = name.FullName;
#else
var name = Assembly.Load(xunitExecutionAssemblyPath);
var testFrameworkAssemblyName = name.FullName;
#endif
// If we didn't get an assemblyInfo object, we can leverage the reflection-based IAssemblyInfo wrapper
if (assemblyInfo == null)
assemblyInfo = appDomain.CreateObject<IAssemblyInfo>(testFrameworkAssemblyName, "Xunit.Sdk.ReflectionAssemblyInfo", assemblyFileName);
framework = appDomain.CreateObject<ITestFramework>(testFrameworkAssemblyName, "Xunit.Sdk.TestFrameworkProxy", assemblyInfo, sourceInformationProvider);
discoverer = Framework.GetDiscoverer(assemblyInfo);
}
示例9: KuduXunitTestFrameworkDiscoverer
public KuduXunitTestFrameworkDiscoverer(IAssemblyInfo assemblyInfo,
ISourceInformationProvider sourceProvider,
IMessageSink diagnosticMessageSink,
IXunitTestCollectionFactory collectionFactory = null)
: base(assemblyInfo, sourceProvider, diagnosticMessageSink, collectionFactory)
{
_privateEnv = typeof(KuduXunitTestFrameworkDiscoverer).Assembly.GetType("Kudu.TestHarness.Antares.AntaresEnvironment") != null;
}
示例10: PerfTestDiscoverer
public PerfTestDiscoverer(
IAssemblyInfo assemblyInfo,
ISourceInformationProvider sourceProvider,
IMessageSink diagnosticMessageSink)
: base(assemblyInfo, sourceProvider, diagnosticMessageSink)
{
_testConfig = new TestConfig();
}
示例11: XunitTestFrameworkExecutor
/// <summary>
/// Initializes a new instance of the <see cref="XunitTestFrameworkExecutor"/> class.
/// </summary>
/// <param name="assemblyName">Name of the test assembly.</param>
/// <param name="sourceInformationProvider">The source line number information provider.</param>
public XunitTestFrameworkExecutor(AssemblyName assemblyName, ISourceInformationProvider sourceInformationProvider)
{
this.sourceInformationProvider = sourceInformationProvider;
var assembly = Assembly.Load(assemblyName);
assemblyInfo = Reflector.Wrap(assembly);
assemblyFileName = assemblyInfo.AssemblyPath;
}
示例12: XunitTestFrameworkExecutor
/// <summary>
/// Initializes a new instance of the <see cref="XunitTestFrameworkExecutor"/> class.
/// </summary>
/// <param name="assemblyFileName">Path of the test assembly.</param>
/// <param name="sourceInformationProvider">The source line number information provider.</param>
public XunitTestFrameworkExecutor(string assemblyFileName, ISourceInformationProvider sourceInformationProvider)
{
this.assemblyFileName = assemblyFileName;
this.sourceInformationProvider = sourceInformationProvider;
var assembly = Assembly.Load(AssemblyName.GetAssemblyName(assemblyFileName));
assemblyInfo = Reflector.Wrap(assembly);
}
示例13: ObservationDiscoverer
public ObservationDiscoverer(IAssemblyInfo assemblyInfo,
ISourceInformationProvider sourceProvider,
IMessageSink diagnosticMessageSink)
: base(assemblyInfo, sourceProvider, diagnosticMessageSink)
{
var testAssembly = new TestAssembly(assemblyInfo, AppDomain.CurrentDomain.SetupInformation.ConfigurationFile);
testCollectionFactory = new CollectionPerClassTestCollectionFactory(testAssembly, diagnosticMessageSink);
}
示例14: Xunit1
/// <summary>
/// Initializes a new instance of the <see cref="Xunit1"/> class.
/// </summary>
/// <param name="sourceInformationProvider">Source code information provider.</param>
/// <param name="assemblyFileName">The test assembly.</param>
/// <param name="configFileName">The test assembly configuration file.</param>
/// <param name="shadowCopy">If set to <c>true</c>, runs tests in a shadow copied app domain, which allows
/// tests to be discovered and run without locking assembly files on disk.</param>
public Xunit1(ISourceInformationProvider sourceInformationProvider, string assemblyFileName, string configFileName = null, bool shadowCopy = true)
{
this.sourceInformationProvider = sourceInformationProvider;
this.assemblyFileName = assemblyFileName;
this.configFileName = configFileName;
executor = CreateExecutor(assemblyFileName, configFileName, shadowCopy);
testCollection = new Xunit1TestCollection(assemblyFileName);
}
示例15: SpecThisTestFrameworkDiscoverer
public SpecThisTestFrameworkDiscoverer(IAssemblyInfo assemblyInfo, ISourceInformationProvider sourceProvider, IMessageSink diagnosticMessageSink, IXunitTestCollectionFactory collectionFactory = null)
: base(assemblyInfo, sourceProvider, diagnosticMessageSink)
{
IAttributeInfo collectionBehaviorAttribute = assemblyInfo.GetCustomAttributes(typeof(CollectionBehaviorAttribute)).SingleOrDefault<IAttributeInfo>();
bool flag = collectionBehaviorAttribute != null && collectionBehaviorAttribute.GetNamedArgument<bool>("DisableTestParallelization");
string configurationFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;
TestAssembly testAssembly = new TestAssembly(assemblyInfo, configurationFile);
this.TestCollectionFactory = collectionFactory ?? ExtensibilityPointFactory.GetXunitTestCollectionFactory(diagnosticMessageSink, collectionBehaviorAttribute, (ITestAssembly)testAssembly);
this.TestFrameworkDisplayName = string.Format("{0} [{1}, {2}]", XunitTestFrameworkDiscoverer.DisplayName, this.TestCollectionFactory.DisplayName, flag ? "non-parallel" : "parallel");
}