예제 #1
0
        public void CheckExcelFileData(string filename, string behavior, Table table)
        {
            var filePath = ConfigServiceBase.DownloadPath + filename;
            var dataList = ListServices.ExcelToCellsList(FileService.GetExcelFileAsDataSet(filePath),
                                                         table.RowCount, table.Rows.First().Count);

            var check = ListServices.CompareTwoLists(dataList, ListServices.TableToCellsList(table));

            File.Delete(filePath);
            check.Should().Be(!behavior.Contains("Not"));
        }
예제 #2
0
        public void CheckTableContainsRows(ITableWrapper gridRows, string behavior, Table table)
        {
            var tableList = ListServices.TableToCellsList(table);

            Assert.ShouldBecome(() => gridRows.Stale, false, $"{gridRows.Caption} is stale");
            Assert.ShouldBecome(() => gridRows.Text.Contains(tableList.FirstOrDefault()), true, $"{gridRows.Caption} text is \"{gridRows.Text}\"");
            var gridRowsCellsText = gridRows.CellsText.ToList();

            Assert.ShouldBecome(() => ListServices.CompareTwoLists(gridRows.CellsText.ToList(), tableList), !behavior.Contains("not"),
                                $"{gridRows.Caption} is {gridRowsCellsText.Aggregate((x, y) => $"{x}, {y}")}");
        }