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); }
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); }
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); }
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); }