private TableRowType CreateHeaderTableRow()
        {
            TableRowType headerTableRow = new TableRowType();

            headerTableRow.Items = new object[] { CreateHeaderTableCells(), "0.25in" };
            return(headerTableRow);
        }
Ejemplo n.º 2
0
 public TabularParameterRow(int rowId, TableRowType type, IEnumerable <IValueResult> values, Exception rowException = null)
 {
     Type                = type;
     Values              = values.ToArray();
     VerificationStatus  = CollectVerificationStatus();
     VerificationMessage = CaptureMessage(rowException, rowId);
 }
        private TableRowType CreateTableRow()
        {
            TableRowType tableRow = new TableRowType();

            tableRow.Items = new object[] { CreateTableCells(), "0.25in" };
            return(tableRow);
        }
Ejemplo n.º 4
0
 public override int GetHashCode()
 {
     unchecked
     {
         return(((TableRowType != null ? TableRowType.GetHashCode() : 0) * 397) ^ (TableName != null ? TableName.GetHashCode() : 0));
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Adds rows according to the amount that it is  sent
 /// </summary>
 /// <param name="AmountOfRows"></param>
 public void AddTableRow(int AmountOfRows, TableRowType type)
 {
     while (AmountOfRows > 0)
     {
         AddTableRow(type);
         AmountOfRows--;
     }
 }
Ejemplo n.º 6
0
        private void AssertRow(ITabularParameterRow row, TableRowType rowType, ParameterVerificationStatus rowStatus, params string[] expectedValueDetails)
        {
            Assert.That(row.Type, Is.EqualTo(rowType));

            var actual = row.Values
                         .Select(v => $"{v.VerificationStatus}|{v.Value}|{v.Expectation}|{v.VerificationMessage ?? "null"}")
                         .ToArray();

            Assert.That(actual, Is.EqualTo(expectedValueDetails));

            Assert.That(row.VerificationStatus, Is.EqualTo(rowStatus));
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Adds a row to the table
        /// </summary>
        public void AddTableRow(TableRowType row)
        {
            switch (row)
            {
            case TableRowType.InputDataRow:
                AddTableRowInputData();


                break;

            case TableRowType.GeneticDataRow:
                AddTableRowGeneticData();
                break;
            }
        }
Ejemplo n.º 8
0
        public void InsertTableData(Dictionary <int, string> newRowData, TableRowType type)
        {
            switch (type)
            {
            case TableRowType.InputDataRow:
                var table   = this.tableLayoutPanel;
                int counter = 0;
                foreach (KeyValuePair <int, string> entry in newRowData)
                {
                    var row = ((InputDataTableRow)table.Controls[table.Controls.Count - 1]);
                    row.tableRow[counter] = entry.Value;
                    counter++;
                }
                break;

            default:
                break;
            }
        }
Ejemplo n.º 9
0
            private static char GetStatus(TableRowType type, ParameterVerificationStatus status)
            {
                switch (type)
                {
                case TableRowType.Missing:
                    return('-');

                case TableRowType.Surplus:
                    return('+');
                }

                switch (status)
                {
                case ParameterVerificationStatus.Success:
                    return('=');

                case ParameterVerificationStatus.NotApplicable:
                    return(' ');
                }

                return('!');
            }
Ejemplo n.º 10
0
 public TestTabularParameterRow(TableRowType type, ParameterVerificationStatus verificationStatus, TestValueResult[] values)
 {
     Type = type;
     VerificationStatus = verificationStatus;
     Values             = values;
 }
Ejemplo n.º 11
0
 public static TestTabularParameterDetails AddRow(this TestTabularParameterDetails details, TableRowType type, ParameterVerificationStatus status, params TestValueResult[] values)
 {
     details.Rows.Add(new TestTabularParameterRow(type, status, values));
     return(details);
 }
Ejemplo n.º 12
0
 public TextRow(TableRowType rowType, ParameterVerificationStatus rowVerificationStatus)
 {
     _status = GetStatus(rowType, rowVerificationStatus);
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Constructor
 /// </summary>
 public RowData(TableRowType type, TRow expected, RowDataActualValue actual)
 {
     Type     = type;
     Expected = expected;
     Actual   = actual;
 }
Ejemplo n.º 14
0
        /// <summary>
        /// Inserts data into the selected table
        /// </summary>
        /// <param name="tableData"></param>
        /// <param name="rowsToCopy"></param>
        public void InsertTableData(List <Dictionary <int, string> > tableData, int rowsToCopy, TableRowType type)
        {
            var table             = this.tableLayoutPanel;
            int amountOfRowsToAdd = rowsToCopy;

            while (amountOfRowsToAdd > 0)
            {
                AddTableRow(type);
                amountOfRowsToAdd--;
            }

            //this is the row of the insertion , row at index 0 is the row of the header
            int currRow;

            //insert when the table just initialized
            if (table.Controls.Count <= rowsToCopy)
            {
                currRow = 1;
            }
            else
            {
                //insert when the table is already full
                currRow = (table.Controls.Count) - rowsToCopy;
            }

            //get the current data of the row to be copied
            foreach (Dictionary <int, string> dic in tableData)
            {
                //access the row in the table to place the data
                var tableRow = (InputDataTableRow)table.Controls[currRow];
                //first control is checkbox - thus we create offset
                int offestIndex = 1;
                foreach (KeyValuePair <int, string> entry in dic)
                {
                    tableRow.Controls[entry.Key + offestIndex].Text = entry.Value;
                }
                currRow++;
            }
            //Assign the data to the actual table rows
        }