コード例 #1
0
        public void GetComponentName(Type type, string expected)
        {
            // Arrange & Act
            var result = ViewComponentConventions.GetComponentName(type.GetTypeInfo());

            // Assert
            Assert.Equal(expected, result);
        }
コード例 #2
0
        private static ViewComponentDescriptor CreateDescriptor(TypeInfo typeInfo)
        {
            var candidate = new ViewComponentDescriptor
            {
                FullName   = ViewComponentConventions.GetComponentFullName(typeInfo),
                ShortName  = ViewComponentConventions.GetComponentName(typeInfo),
                TypeInfo   = typeInfo,
                MethodInfo = FindMethod(typeInfo.AsType())
            };

            return(candidate);
        }