GetDisplayName() public static méthode

Gets the display name for a Type as used by NUnit.
public static GetDisplayName ( Type type ) : string
type System.Type The Type for which a display name is needed.
Résultat string
        /// <summary>
        /// Initializes a new instance of the <see cref="TestSuite"/> class.
        /// </summary>
        /// <param name="fixtureType">Type of the fixture.</param>
        public TestSuite(Type fixtureType) : base(fixtureType)
        {
            string name   = this.Name = TypeHelper.GetDisplayName(fixtureType);
            string nspace = fixtureType.Namespace;

            this.FullName = nspace != null && nspace != ""
                ? nspace + "." + name
                : name;
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TestSuite"/> class.
        /// </summary>
        /// <param name="fixtureType">Type of the fixture.</param>
        public TestSuite(Type fixtureType) : base(fixtureType)
        {
            Name = TypeHelper.GetDisplayName(fixtureType);
            string nspace = fixtureType.Namespace;

            FullName = nspace != null && nspace != ""
                ? nspace + "." + Name
                : Name;
            Arguments = new object[0];
        }
Exemple #3
0
        /// <summary>
        /// Constructs a test for a specific type.
        /// </summary>
        protected Test(Type type)
        {
            Initialize(TypeHelper.GetDisplayName(type));

            string nspace = type.Namespace;

            if (nspace != null && nspace != "")
            {
                FullName = nspace + "." + Name;
            }
            Type = type;
        }
Exemple #4
0
        public TestSuite(Type fixtureType, object[] arguments)
            : base(fixtureType)
        {
            string text2      = (base.FullName = (base.Name = TypeHelper.GetDisplayName(fixtureType, arguments)));
            string @namespace = fixtureType.Namespace;

            if (@namespace != null && @namespace != "")
            {
                base.FullName = @namespace + "." + text2;
            }
            base.arguments = arguments;
        }
Exemple #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TestSuite"/> class.
        /// </summary>
        /// <param name="fixtureType">Type of the fixture.</param>
        /// <param name="arguments">The arguments.</param>
        public TestSuite(Type fixtureType, object[] arguments)
            : base(fixtureType)
        {
            string name = TypeHelper.GetDisplayName(fixtureType, arguments);

            this.Name = name;

            this.FullName = name;
            string nspace = fixtureType.Namespace;

            if (nspace != null && nspace != "")
            {
                this.FullName = nspace + "." + name;
            }
            this.arguments = arguments;
        }
Exemple #6
0
 /// <summary>
 /// Get the display name for an object of this type, constructed with the specified args.
 /// </summary>
 public string GetDisplayName(object[] args)
 {
     return(TypeHelper.GetDisplayName(Type, args));
 }
Exemple #7
0
 /// <summary>
 /// Get the display name for this type
 /// </summary>
 public string GetDisplayName()
 {
     return(TypeHelper.GetDisplayName(Type));
 }
Exemple #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ParameterizedFixtureSuite"/> class.
 /// </summary>
 /// <param name="type">The type.</param>
 public ParameterizedFixtureSuite(Type type) : base(type.Namespace, TypeHelper.GetDisplayName(type))
 {
     this.type = type;
 }
Exemple #9
0
 public string GetDisplayNameTests(Type type)
 {
     return(TypeHelper.GetDisplayName(type));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ParameterizedFixtureSuite"/> class.
 /// </summary>
 /// <param name="type">The type that represents the suite.</param>
 public ParameterizedFixtureSuite(Type type) : base(type.Namespace, TypeHelper.GetDisplayName(type))
 {
     _genericFixture = type.GetTypeInfo().ContainsGenericParameters;
 }