private IDataEntryForm Build(IDataEntryForm dataEntryForm, List <List <ITrueControl> > dataListofList) { int maxCols = 0; foreach (var datalist in dataListofList) { if (datalist.Count > maxCols) { maxCols = datalist.Count; } } dataEntryForm.AddRows(dataListofList.Count); dataEntryForm.AddCols(maxCols); for (var r = 0; r < dataListofList.Count; r++) { for (var c = 0; c < dataListofList[r].Count; c++) { dataEntryForm.InsertControl(dataListofList[r][c], r + 1, c + 1); } } return(dataEntryForm); }
public void Apply_CorrectColsAdded() { var data = new List <List <ITrueControl> > { new List <ITrueControl> { new LabelWrapper() { Text = "a" }, new LabelWrapper() { Text = "b" } }, new List <ITrueControl> { new LabelWrapper() { Text = "1" }, new LabelWrapper() { Text = "2" }, new LabelWrapper() { Text = "3" } } }; _builder.Apply(_dataEntryForm, data); A.CallTo(() => _dataEntryForm.AddCols(3)).MustHaveHappened(); }