| 221 | } |
| 222 | |
| 223 | void TestStringData::testRemoveRow() { |
| 224 | QtCSV::StringData strData; |
| 225 | strData.removeRow(0); |
| 226 | strData.removeRow(563); |
| 227 | |
| 228 | QVERIFY2(strData.isEmpty(), "Container is not empty"); |
| 229 | |
| 230 | QList<QString> valuesFirst, valuesSecond; |
| 231 | valuesFirst << "one" << "two" << "three"; |
| 232 | valuesSecond << "asgreg" << "ertetw" << ""; |
| 233 | |
| 234 | QString stringOne("hey test"), stringTwo("sdfwioiouoioi"); |
| 235 | |
| 236 | strData << valuesFirst << valuesSecond << stringOne << stringTwo; |
| 237 | |
| 238 | strData.removeRow(2); |
| 239 | |
| 240 | QVERIFY2(3 == strData.rowCount(), "Wrong number of rows"); |
| 241 | QVERIFY2(valuesFirst == strData.rowValues(0), "Wrong data for first row"); |
| 242 | QVERIFY2(valuesSecond == strData.rowValues(1), "Wrong data for second row"); |
| 243 | QVERIFY2((QList<QString>() << stringTwo) == strData.rowValues(2), |
| 244 | "Wrong data for third row"); |
| 245 | } |
| 246 | |
| 247 | void TestStringData::testReplaceRow() { |
| 248 | QList<QString> valuesFirst, valuesSecond; |