Exemplo n.º 1
0
        public void IsComponent(Type type, bool expected)
        {
            // Arrange & Act
            var result = ViewComponentConventions.IsComponent(type.GetTypeInfo());

            // Assert
            Assert.Equal(expected, result);
        }
        /// <summary>
        /// Determines whether or not the given <see cref="TypeInfo"/> is a view component class.
        /// </summary>
        /// <param name="typeInfo">The <see cref="TypeInfo"/>.</param>
        /// <returns>
        /// <c>true</c> if <paramref name="typeInfo"/>represents a view component class, otherwise <c>false</c>.
        /// </returns>
        protected virtual bool IsViewComponentType(TypeInfo typeInfo)
        {
            if (typeInfo == null)
            {
                throw new ArgumentNullException(nameof(typeInfo));
            }

            return(ViewComponentConventions.IsComponent(typeInfo));
        }
 /// <summary>
 /// Determines whether or not the given <see cref="TypeInfo"/> is a View Component class.
 /// </summary>
 /// <param name="typeInfo">The <see cref="TypeInfo"/>.</param>
 /// <returns>
 /// <c>true</c> if <paramref name="typeInfo"/>represents a View Component class, otherwise <c>false</c>.
 /// </returns>
 protected virtual bool IsViewComponentType([NotNull] TypeInfo typeInfo)
 {
     return(ViewComponentConventions.IsComponent(typeInfo));
 }