示例#1
0
        public static Cell For(CellHandling cells, ParameterInfo parameter, Fixture fixture)
        {
            var isOutput = false;
            var type     = parameter.ParameterType;

            if (parameter.IsOut)
            {
                type     = type.GetElementType();
                isOutput = true;
            }

            if (type.Closes(typeof(Task <>)))
            {
                type = type.GetGenericArguments().Single();
            }

            var cell = new Cell(cells, parameter.Name, type)
            {
                result = isOutput, Position = parameter.Position
            };

            parameter.ForAttribute <ModifyCellAttribute>(x => x.Modify(cell));
            type.ForAttribute <ModifyCellAttribute>(x => x.Modify(cell));

            if (parameter.HasDefaultValue)
            {
                cell.DefaultValue = parameter.DefaultValue?.ToString() ?? "NULL";
            }


            cell.readLists(cells, fixture);

            return(cell);
        }
示例#2
0
        public static Cell For(CellHandling cells, Accessor accessor, Fixture fixture)
        {
            var cell = new Cell(cells, accessor.Name, accessor.PropertyType);

            accessor.ForAttribute <ModifyCellAttribute>(x => x.Modify(cell));

            cell.readLists(cells, fixture);

            return(cell);
        }
示例#3
0
        public static Cell For(CellHandling cells, PropertyInfo property, Fixture fixture)
        {
            var cell = new Cell(cells, property.Name, property.PropertyType);

            property.ForAttribute <ModifyCellAttribute>(x => x.Modify(cell));

            cell.readLists(cells, fixture);

            return(cell);
        }
示例#4
0
        public static Cell For(CellHandling cells, string key, Type type, CellModifications modifications, Fixture fixture)
        {
            var cell = new Cell(cells, key, type);

            modifications.Apply(cell);

            cell.readLists(cells, fixture);

            return(cell);
        }