using System.Reflection;
namespace UnitTests;
///
/// Helpers for View tests.
///
public class ViewTestHelpers
{
public static View CreateViewFromType (Type type, ConstructorInfo ctor)
{
View viewType = null;
if (type.IsGenericType && type.IsTypeDefinition)
{
List gTypes = new ();
foreach (Type args in type.GetGenericArguments ())
{
gTypes.Add (typeof (object));
}
type = type.MakeGenericType (gTypes.ToArray ());
Assert.IsType (type, (View)Activator.CreateInstance (type));
}
else
{
ParameterInfo [] paramsInfo = ctor.GetParameters ();
Type paramType;
List