GetAssemblyName() публичный статический Метод

Gets the AssemblyName of an assembly.
public static GetAssemblyName ( Assembly assembly ) : AssemblyName
assembly System.Reflection.Assembly The assembly
Результат System.Reflection.AssemblyName
        /// <summary>
        /// Build a suite of tests from a provided assembly
        /// </summary>
        /// <param name="assembly">The assembly from which tests are to be built</param>
        /// <param name="options">A dictionary of options to use in building the suite</param>
        /// <returns>
        /// A TestSuite containing the tests found in the assembly
        /// </returns>
        public ITest Build(Assembly assembly, IDictionary options)
        {
            this.assembly = assembly;

            IList fixtureNames = options["LOAD"] as IList;

            IList fixtures = GetFixtures(assembly, fixtureNames);

#if NETCF || SILVERLIGHT
            AssemblyName assemblyName = AssemblyHelper.GetAssemblyName(assembly);
            return(BuildTestAssembly(assemblyName.Name, fixtures));
#else
            string assemblyPath = AssemblyHelper.GetAssemblyPath(assembly);
            return(BuildTestAssembly(assemblyPath, fixtures));
#endif
        }
        /// <summary>
        /// Build a suite of tests from a provided assembly
        /// </summary>
        /// <param name="assembly">The assembly from which tests are to be built</param>
        /// <param name="options">A dictionary of options to use in building the suite</param>
        /// <returns>
        /// A TestSuite containing the tests found in the assembly
        /// </returns>
        public TestSuite Build(Assembly assembly, IDictionary options)
        {
            this.assembly = assembly;

            IList fixtureNames = options["LOAD"] as IList;

            IList fixtures = GetFixtures(assembly, fixtureNames);

            if (fixtures.Count > 0)
            {
                AssemblyName assemblyName = AssemblyHelper.GetAssemblyName(assembly);
                return(BuildTestAssembly(assemblyName.Name, fixtures));
            }

            return(null);
        }
        /// <summary>
        /// Build a suite of tests from a provided assembly
        /// </summary>
        /// <param name="assembly">The assembly from which tests are to be built</param>
        /// <param name="options">A dictionary of options to use in building the suite</param>
        /// <returns>
        /// A TestSuite containing the tests found in the assembly
        /// </returns>
        public TestSuite Build(Assembly assembly, IDictionary options)
        {
            this.assembly = assembly;

            IList fixtureNames = options["LOAD"] as IList;

            IList fixtures = GetFixtures(assembly, fixtureNames);

            if (fixtures.Count > 0)
            {
#if NETCF || SILVERLIGHT || PORTABLE
                AssemblyName assemblyName = AssemblyHelper.GetAssemblyName(assembly);
                return(BuildTestAssembly(assemblyName.Name, fixtures));
#else
                string assemblyPath = AssemblyHelper.GetAssemblyPath(assembly);
                return(BuildTestAssembly(assemblyPath, fixtures));
#endif
            }

            return(null);
        }
Пример #4
0
        public void GetNameForAssembly()
        {
            var assemblyName = AssemblyHelper.GetAssemblyName(this.GetType().GetTypeInfo().Assembly);

            Assert.That(assemblyName.Name, Is.EqualTo(THIS_ASSEMBLY_NAME).IgnoreCase);
        }