2 * Copyright (C) 2005-2013 Team XBMC
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with XBMC; see the file COPYING. If not, see
17 * <http://www.gnu.org/licenses/>.
21 #include "utils/HTMLTable.h"
23 #include "gtest/gtest.h"
29 // virtual ~CHTMLRow(void);
30 // int GetColumns() const;
31 // const CStdString& GetColumValue(int iColumn) const;
32 // void Parse(const CStdString& strTableRow);
35 // std::vector<CStdString> m_vecColums;
42 // virtual ~CHTMLTable(void);
43 // void Parse(const CStdString& strHTML);
44 // int GetRows() const;
45 // const CHTMLRow& GetRow(int iRow) const;
47 // std::vector<CHTMLRow> m_vecRows;
50 TEST(TestHTMLTable, General)
52 HTML::CHTMLTable table;
53 HTML::CHTMLRow row1, row2;
70 EXPECT_EQ(3, table.GetRows());
72 row1 = table.GetRow(0);
73 EXPECT_EQ(2, row1.GetColumns());
74 EXPECT_STREQ("r1c1", row1.GetColumValue(0));
77 " <td>new row1 column1</td>\n"
78 " <td>new row1 column2</td>\n"
79 " <td>new row1 column3</td>\n"
82 EXPECT_EQ(3, row2.GetColumns());
83 EXPECT_STREQ("new row1 column2", row2.GetColumValue(1));