Пример #1
0
        internal static PdfPTable GetBodyTable(this RunScenario scenario, int testRun)
        {
            var table     = new PdfPTable(new[] { 0.25f, 0.75f }); //two cols 1/3, 2/3
            var bodyProps = scenario.GetBodyProperties().ToList();

            bodyProps.Insert(1, new KeyValuePair <string, object>("Tet Run #", testRun));

            foreach (var kv in bodyProps)
            {
                table.AddCell(kv.Key.GetNormalCell());

                var value = kv.Value;
                if (kv.Key.Equals("RunTime"))
                {
                    value += " Sec";
                }

                if (kv.Key.Equals("Headers"))
                {
                    table.AddCell(GetSummaryTable((IEnumerable <KeyValuePair <string, object> >)value, Rectangle.LISTITEM, 0.25f, 0.75f));
                }
                else
                {
                    table.AddCell(value.GetNormalCell(font: null, hasBackground: kv.Key.Equals("Name")));
                }
            }

            return(table);
        }