protected DesignRequest CreateDesignFromRandomImageAsync() { var rand = new Random(); var files = Directory.GetFiles("C:\\BFU\\350years\\pngs", "*.png"); var randomImageFileName = files[rand.Next(files.Length)]; var design = new DesignRequest { name = $"Design created on {DateTime.Now}", type = DesignTypes.dtg, sides = new DesignSides { front = new DesignSide { artwork = randomImageFileName, aspect = 1, resize = true, dimensions = Dimension.Width(11), position = new Position { horizontal = "C", offset = PositionOffset.FromTop(2.5f) } } } }; return(design); }
public void GivenTheTableOfData(Table table) { var row = table.CreateInstance <DesignTableRow>(); design.name = row.name; design.type = Enum.Parse <DesignTypes>(row.type); design.sides.front = new DesignSide { artwork = row.sides_front_artwork, proof = row.sides_front_proof, aspect = 1, resize = true, dimensions = Dimension.Width(row.sides_front_dimensions_width), position = new Position { horizontal = row.sides_front_position_horizontal, offset = PositionOffset.FromTop(row.sides_front_position_offset_top) } }; }