public void GetComponentName(Type type, string expected) { // Arrange & Act var result = ViewComponentConventions.GetComponentName(type.GetTypeInfo()); // Assert Assert.Equal(expected, result); }
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); }