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


C# IAssemblyInfo.Resolve方法代码示例

本文整理汇总了C#中IAssemblyInfo.Resolve方法的典型用法代码示例。如果您正苦于以下问题:C# IAssemblyInfo.Resolve方法的具体用法?C# IAssemblyInfo.Resolve怎么用?C# IAssemblyInfo.Resolve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IAssemblyInfo的用法示例。


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

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

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

示例3: GetInputOutputDirectories

        private void GetInputOutputDirectories(IAssemblyInfo assembly)
        {
            var config = new SpecificationConfig().Load(assembly.Resolve(false));

            var baseInputDirectoryInfo = new DirectoryInfo(config.BaseInputDirectory);
            if (baseInputDirectoryInfo.Exists)
            {
            }
            else
            {
               TestModel.AddAnnotation(new Annotation(AnnotationType.Error, assembly, String.Format("The Base Input Directory {0} does not exist, reverting to default", config.BaseInputDirectory)));
            }

            var baseOutputDirectoryInfo = new DirectoryInfo(config.BaseOutputDirectory);
            this._baseOutputDirectory = baseOutputDirectoryInfo;

            if (!_baseOutputDirectory.Exists)
            {
                Directory.CreateDirectory(_baseOutputDirectory.FullName);
            }
        }
开发者ID:ElviraH,项目名称:concordion-net,代码行数:21,代码来源:ConcordionTestExplorer.cs

示例4: 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 )
            {
                Assembly resolvedAssembly = assembly.Resolve( false );
                var finder = new SpecFinder( resolvedAssembly, new NSpec.Domain.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:JosephJung,项目名称:NSpec,代码行数:33,代码来源:NSpecTestExplorer.cs


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