예제 #1
0
파일: Cell.cs 프로젝트: nasimg/Storyteller
        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
파일: Cell.cs 프로젝트: nasimg/Storyteller
        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);
        }