当前位置: 首页>>代码示例>>C#>>正文


C# ISourceInformationProvider类代码示例

本文整理汇总了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();
        }
开发者ID:johnkg,项目名称:xunit,代码行数:12,代码来源:XunitTestFrameworkDiscoverer.cs

示例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)
 {
 }
开发者ID:RichiCoder1,项目名称:Browser.xUnit,代码行数:11,代码来源:BrowserTestFrameworkExecutor.cs

示例3: KuduXunitTestFrameworkDiscoverer

 public KuduXunitTestFrameworkDiscoverer(IAssemblyInfo assemblyInfo,
                                         ISourceInformationProvider sourceProvider,
                                         IMessageSink diagnosticMessageSink,
                                         IXunitTestCollectionFactory collectionFactory = null)
     : base(assemblyInfo, sourceProvider, diagnosticMessageSink, collectionFactory)
 {
 }
开发者ID:sr457,项目名称:kudu,代码行数:7,代码来源:KuduXunitTestFrameworkDiscoverer.cs

示例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);
        }
开发者ID:navApiDev,项目名称:xunit,代码行数:35,代码来源:Xunit2Discoverer.cs

示例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) { }
开发者ID:remcomulder,项目名称:xunit,代码行数:8,代码来源:Xunit2Discoverer.cs

示例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);
            }

        }
开发者ID:xunit,项目名称:xunit,代码行数:41,代码来源:XunitFrontController.cs

示例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);
            }

        }
开发者ID:remcomulder,项目名称:xunit,代码行数:38,代码来源:XunitFrontController.cs

示例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);
        }
开发者ID:kerryjiang,项目名称:xunit,代码行数:29,代码来源:Xunit2Discoverer.cs

示例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;
 }
开发者ID:NorimaConsulting,项目名称:kudu,代码行数:8,代码来源:KuduXunitTestFrameworkDiscoverer.cs

示例10: PerfTestDiscoverer

 public PerfTestDiscoverer(
     IAssemblyInfo assemblyInfo,
     ISourceInformationProvider sourceProvider,
     IMessageSink diagnosticMessageSink)
     : base(assemblyInfo, sourceProvider, diagnosticMessageSink)
 {
     _testConfig = new TestConfig();
 }
开发者ID:aishaloshik,项目名称:EntityFramework,代码行数:8,代码来源:TestConfig.cs

示例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;
        }
开发者ID:PKRoma,项目名称:xunit-codeplex,代码行数:13,代码来源:XunitTestFrameworkExecutor.cs

示例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);
        }
开发者ID:valmaev,项目名称:xunit,代码行数:13,代码来源:XunitTestFrameworkExecutor.cs

示例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);
 }
开发者ID:Vasiliauskas,项目名称:samples.xunit,代码行数:8,代码来源:ObservationDiscoverer.cs

示例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);
        }
开发者ID:JayBazuzi,项目名称:xunit,代码行数:17,代码来源:Xunit1.cs

示例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");
 }
开发者ID:BrunoJuchli,项目名称:SpecThisXUnitSpike,代码行数:10,代码来源:SpecThisTestFrameworkDiscoverer.cs


注:本文中的ISourceInformationProvider类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。