Exemplo n.º 1
0
        public void Csv_2_Table_from_file_readed()
        {
            // Arrange
            var csvString = System.IO.File.ReadAllText(@"goodData.csv");

            // Act
            var isTable = SpecflowHelpers.Csv2Table(csvString);

            //Assert
            Assert.Empty(SpecflowHelpers.CompareTables(isTable, shouldTable));
        }
Exemplo n.º 2
0
        public void Compare_Tables_with_regex()
        {
            // Arrange
            var csvString = "head1,head2,head3\r\nval1,regex:val[0-9],val3";

            // Act
            var isTable = SpecflowHelpers.Csv2Table(csvString);

            //Assert
            Assert.Empty(SpecflowHelpers.CompareTables(isTable, shouldTable));
        }
Exemplo n.º 3
0
        public void Csv2Table_with_identic_table()
        {
            // Arrange
            var csvString = "head1,head2,head3\r\nval1,val2,val3";

            // Act
            var isTable = SpecflowHelpers.Csv2Table(csvString);

            //Assert
            Assert.Empty(SpecflowHelpers.CompareTables(isTable, shouldTable));
        }
Exemplo n.º 4
0
        public void ThenTheTableComparerShouldWorkRight(Table sTable)
        {
            DataTable tTable = new DataTable();

            tTable.Clear();
            tTable.Columns.Add("Col1");
            tTable.Columns.Add("Col2");
            tTable.Columns.Add("Col3");
            DataRow _row = tTable.NewRow();

            _row["Col1"] = "Value 1";
            _row["Col2"] = "Value 2";
            _row["Col3"] = "Value 3";
            tTable.Rows.Add(_row);
            List <string> result = SpecflowHelpers.CompareTables(sTable, tTable);

            Assert.True(result.Count == 0, $"\r\n{string.Join("\r\n", result)}\r\n");
        }