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


C# IAssemblyInfo类代码示例

本文整理汇总了C#中IAssemblyInfo的典型用法代码示例。如果您正苦于以下问题:C# IAssemblyInfo类的具体用法?C# IAssemblyInfo怎么用?C# IAssemblyInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IAssemblyInfo类属于命名空间,在下文中一共展示了IAssemblyInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetAssemblyLoaders

 public static IList<AssemblyLoaderAttribute> GetAssemblyLoaders(IAssemblyInfo assemblyInfo) {
     return assemblyInfo.GetCustomAttributes(typeof(AssemblyLoaderAttribute))
         .OfType<IReflectionAttributeInfo>()
         .Select(ai => ai.Attribute)
         .OfType<AssemblyLoaderAttribute>()
         .ToList();
 }
开发者ID:Microsoft,项目名称:RTVS,代码行数:7,代码来源:AssemblyLoaderAttribute.cs

示例2: Initialize

        void Initialize(ITestCollection testCollection, IAssemblyInfo assembly, ITypeInfo type, IMethodInfo method, IAttributeInfo factAttribute, object[] arguments)
        {
            string displayNameBase = factAttribute.GetNamedArgument<string>("DisplayName") ?? type.Name + "." + method.Name;
            ITypeInfo[] resolvedTypes = null;

            if (arguments != null && method.IsGenericMethodDefinition)
            {
                resolvedTypes = ResolveGenericTypes(method, arguments);
                method = method.MakeGenericMethod(resolvedTypes);
            }

            Assembly = assembly;
            Class = type;
            Method = method;
            Arguments = arguments;
            DisplayName = GetDisplayNameWithArguments(displayNameBase, arguments, resolvedTypes);
            SkipReason = factAttribute.GetNamedArgument<string>("Skip");
            Traits = new Dictionary<string, List<string>>(StringComparer.OrdinalIgnoreCase);
            TestCollection = testCollection;

            foreach (var traitAttribute in Method.GetCustomAttributes(typeof(ITraitAttribute))
                                                 .Concat(Class.GetCustomAttributes(typeof(ITraitAttribute))))
            {
                var discovererAttribute = traitAttribute.GetCustomAttributes(typeof(TraitDiscovererAttribute)).First();
                var discoverer = ExtensibilityPointFactory.GetTraitDiscoverer(discovererAttribute);
                if (discoverer != null)
                    foreach (var keyValuePair in discoverer.GetTraits(traitAttribute))
                        Traits.Add(keyValuePair.Key, keyValuePair.Value);
            }

            uniqueID = new Lazy<string>(GetUniqueID, true);
        }
开发者ID:vkomarovsky-sugarcrm,项目名称:xunit,代码行数:32,代码来源:XunitTestCase.cs

示例3: GetAssemblyTest

        private Test GetAssemblyTest(IAssemblyInfo assembly, Test parentTest, Version frameworkVersion)
        {
            Test assemblyTest;
            if (assemblyTests.TryGetValue(assembly, out assemblyTest))
                return assemblyTest;

            try
            {
                Assembly loadedAssembly = assembly.Resolve(false);

                if (Reflector.IsUnresolved(loadedAssembly))
                    assemblyTest = BuildAssemblyTest_Reflective(assembly);
                else
                    assemblyTest = BuildAssemblyTest_Native(assembly, loadedAssembly.Location);

                string frameworkName = String.Format(Resources.CSUnitTestExplorer_FrameworkNameWithVersionFormat, frameworkVersion);
                assemblyTest.Metadata.SetValue(MetadataKeys.Framework, frameworkName);
                assemblyTest.Metadata.SetValue(MetadataKeys.File, assembly.Path);
                assemblyTest.Kind = AssemblyKind;
            }
            catch (Exception ex)
            {
                TestModel.AddAnnotation(new Annotation(AnnotationType.Error, assembly,
                    "An exception was thrown while exploring a csUnit test assembly.", ex));
                return null;
            }

            if (assemblyTest != null)
            {
                parentTest.AddChild(assemblyTest);
                
                assemblyTests.Add(assembly, assemblyTest);
            }
            return assemblyTest;
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:35,代码来源:CSUnitTestExplorer.cs

示例4: 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

示例5: GetAssemblyTest

        private Test GetAssemblyTest(IAssemblyInfo assembly, Test parentTest, Version frameworkVersion, bool populateRecursively)
        {
            Test assemblyTest;
            if (!assemblyTests.TryGetValue(assembly, out assemblyTest))
            {
                assemblyTest = CreateAssemblyTest(assembly);

                String frameworkName = CONCORDION_ASSEMBLY_DISPLAY_NAME;
                assemblyTest.Metadata.SetValue(MetadataKeys.Framework, frameworkName);
                assemblyTest.Metadata.SetValue(MetadataKeys.File, assembly.Path);
                assemblyTest.Kind = AssemblyKind;

                parentTest.AddChild(assemblyTest);
                assemblyTests.Add(assembly, assemblyTest);
            }

            GetInputOutputDirectories(assembly);

            if (populateRecursively)
            {
                foreach (var type in assembly.GetExportedTypes())
                    TryGetTypeTest(type, assemblyTest);
            }

            return assemblyTest;
        }
开发者ID:ManiAzizzadeh,项目名称:Concordion.NET,代码行数:26,代码来源:ConcordionTestExplorer.cs

示例6: CSUnitAssemblyTest

        /// <inheritdoc />
        public CSUnitAssemblyTest(IAssemblyInfo assembly, string location)
            : base(assembly.Name, assembly)
        {
            Kind = TestKinds.Assembly;

            this.location = location;
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:8,代码来源:CSUnitAssemblyTest.cs

示例7: GetAssemblyTest

    Test GetAssemblyTest(IAssemblyInfo assembly, Test parentTest, Version frameworkVersion, bool populateRecursively)
    {
      MachineAssemblyTest assemblyTest;
      if (!assemblyTests.TryGetValue(assembly, out assemblyTest))
      {
        assemblyTest = new MachineAssemblyTest(assembly.Name, assembly, frameworkVersion);
        assemblyTest.Kind = TestKinds.Assembly;

        ModelUtils.PopulateMetadataFromAssembly(assembly, assemblyTest.Metadata);

        string frameworkName = String.Format("Machine Specifications v{0}", frameworkVersion);
        assemblyTest.Metadata.SetValue(MetadataKeys.Framework, frameworkName);
        assemblyTest.Metadata.SetValue(MetadataKeys.File, assembly.Path);
        assemblyTest.Kind = TestKinds.Assembly;

        parentTest.AddChild(assemblyTest);
        assemblyTests.Add(assembly, assemblyTest);
      }

      if (populateRecursively)
      {
        AssemblyExplorer explorer = new AssemblyExplorer();
        Assembly resolvedAssembly = assembly.Resolve(false);

        assemblyTest.AssemblyContexts = explorer.FindAssemblyContextsIn( resolvedAssembly).ToList();
        assemblyTest.GlobalCleanup = explorer.FindAssemblyWideContextCleanupsIn(resolvedAssembly).ToList();
        assemblyTest.SpecificationSupplements = explorer.FindSpecificationSupplementsIn(resolvedAssembly).ToList();
        
        explorer.FindContextsIn(resolvedAssembly)
          .Select( context => GetContextTest( context))
          .Each( test => assemblyTest.AddChild( test));
      }

      return assemblyTest;
    }
开发者ID:agross,项目名称:machine.specifications,代码行数:35,代码来源:MachineSpecificationsExplorer.cs

示例8: ConvertConfigPaths

        public static void ConvertConfigPaths(IAssemblyInfo assemblyInfo)
        {
            if (!string.IsNullOrWhiteSpace(assemblyInfo.AfterBuild))
            {
                assemblyInfo.AfterBuild = helper.ConvertPath(assemblyInfo.AfterBuild);
            }

            if (!string.IsNullOrWhiteSpace(assemblyInfo.BeforeBuild))
            {
                assemblyInfo.BeforeBuild = helper.ConvertPath(assemblyInfo.BeforeBuild);
            }

            if (!string.IsNullOrWhiteSpace(assemblyInfo.Output))
            {
                assemblyInfo.Output = helper.ConvertPath(assemblyInfo.Output);
            }

            if (!string.IsNullOrWhiteSpace(assemblyInfo.PluginsPath))
            {
                assemblyInfo.PluginsPath = helper.ConvertPath(assemblyInfo.PluginsPath);
            }

            if (!string.IsNullOrWhiteSpace(assemblyInfo.LocalesOutput))
            {
                assemblyInfo.LocalesOutput = helper.ConvertPath(assemblyInfo.LocalesOutput);
            }
        }
开发者ID:wangxueqzz,项目名称:Bridge,代码行数:27,代码来源:AssemblyConfigHelper.cs

示例9: GetInternalVisibleToAttributes

        private static IEnumerable<CustomAttribute> GetInternalVisibleToAttributes( IAssemblyInfo assemblyInfo )
        {
            var internalVisibleToAttributes = assemblyInfo.Assembly.CustomAttributes
                    .Where( t => t.AttributeType.FullName == AttributeFullName );

            return internalVisibleToAttributes;
        }
开发者ID:rjasica,项目名称:sign,代码行数:7,代码来源:UpdateInternalVisibleToAttribute.cs

示例10: DecorateAssemblyTest

 /// <inheritdoc />
 protected override void DecorateAssemblyTest(IPatternScope assemblyScope, IAssemblyInfo assembly)
 {
     assemblyScope.TestBuilder.TestActions.InitializeTestChain.After(state =>
     {
         TestAssemblyExecutionParameters.DegreeOfParallelism = degreeOfParallelism;
     });
 }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:8,代码来源:DegreeOfParallelismAttribute.cs

示例11: NUnitReflectiveTestExplorerEngine

        public NUnitReflectiveTestExplorerEngine(TestModel testModel, IAssemblyInfo assembly)
        {
            this.testModel = testModel;
            this.assembly = assembly;

            nunitFixtures = new List<NUnit.Core.TestSuite>();
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:7,代码来源:NUnitReflectiveTestExplorerEngine.cs

示例12: GetAssemblyTest

        Test GetAssemblyTest(IAssemblyInfo assembly, Test parentTest, Version frameworkVersion, bool populateRecursively)
        {
            NSpecAssemblyTest assemblyTest;

            if (!assemblyTests.TryGetValue(assembly, out assemblyTest))
            {
                assemblyTest = new NSpecAssemblyTest(assembly.Name, assembly, frameworkVersion);
                assemblyTest.Kind = TestKinds.Assembly;

                ModelUtils.PopulateMetadataFromAssembly(assembly, assemblyTest.Metadata);

                string frameworkName = String.Format("NSpec v{0}", frameworkVersion);
                assemblyTest.Metadata.SetValue(MetadataKeys.Framework, frameworkName);
                assemblyTest.Metadata.SetValue(MetadataKeys.File, assembly.Path);
                assemblyTest.Kind = TestKinds.Assembly;

                parentTest.AddChild(assemblyTest);
                assemblyTests.Add(assembly, assemblyTest);
            }

            if (populateRecursively)
            {
                var reflector = new NSpec.Domain.Reflector(assembly.Path);
                var finder = new SpecFinder(reflector);
                var builder = new ContextBuilder(finder, new DefaultConventions());

                ContextCollection contexts = builder.Contexts();
                contexts.Build();
                contexts.Do(c => assemblyTest.AddChild(this.CreateGallioTestFrom(c)));
            }

            return assemblyTest;
        }
开发者ID:BrainCrumbz,项目名称:NSpec,代码行数:33,代码来源:NSpecTestExplorer.cs

示例13: GetTestFrameworkType

        static Type GetTestFrameworkType(IAssemblyInfo testAssembly, IMessageSink diagnosticMessageSink)
        {
            try
            {
                var testFrameworkAttr = testAssembly.GetCustomAttributes(typeof(ITestFrameworkAttribute)).FirstOrDefault();
                if (testFrameworkAttr != null)
                {
                    var discovererAttr = testFrameworkAttr.GetCustomAttributes(typeof(TestFrameworkDiscovererAttribute)).FirstOrDefault();
                    if (discovererAttr != null)
                    {
                        var discoverer = ExtensibilityPointFactory.GetTestFrameworkTypeDiscoverer(diagnosticMessageSink, discovererAttr);
                        if (discoverer != null)
                            return discoverer.GetTestFrameworkType(testFrameworkAttr);

                        var ctorArgs = discovererAttr.GetConstructorArguments().ToArray();
                        diagnosticMessageSink.OnMessage(new DiagnosticMessage($"Unable to create custom test framework discoverer type '{ctorArgs[1]}, {ctorArgs[0]}'"));
                    }
                    else
                    {
                        diagnosticMessageSink.OnMessage(new DiagnosticMessage("Assembly-level test framework attribute was not decorated with [TestFrameworkDiscoverer]"));
                    }
                }
            }
            catch (Exception ex)
            {
                diagnosticMessageSink.OnMessage(new DiagnosticMessage($"Exception thrown during test framework discoverer construction: {ex.Unwrap()}"));
            }

            return typeof(XunitTestFramework);
        }
开发者ID:modai888,项目名称:xunit,代码行数:30,代码来源:TestFrameworkProxy.cs

示例14: Xunit2Discoverer

        Xunit2Discoverer(ISourceInformationProvider sourceInformationProvider,
                         IAssemblyInfo assemblyInfo,
                         string assemblyFileName,
                         string xunitExecutionAssemblyPath,
                         string configFileName,
                         bool shadowCopy,
                         string shadowCopyFolder,
                         IMessageSink diagnosticMessageSink)
        {
            Guard.ArgumentNotNull("assemblyInfo", (object)assemblyInfo ?? assemblyFileName);
            Guard.FileExists("xunitExecutionAssemblyPath", xunitExecutionAssemblyPath);

            DiagnosticMessageSink = diagnosticMessageSink ?? new NullMessageSink();

            appDomain = new RemoteAppDomainManager(assemblyFileName ?? xunitExecutionAssemblyPath, 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:remcomulder,项目名称:xunit,代码行数:25,代码来源:Xunit2Discoverer.cs

示例15: 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


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