! * read the full table import in the replace mode */
| 37 | * read the full table import in the replace mode |
| 38 | */ |
| 39 | void ImportSqlDatabaseTest::testFullTableReplace() { |
| 40 | // prepare the target spreadsheet |
| 41 | Spreadsheet spreadsheet(QStringLiteral("test"), false); |
| 42 | |
| 43 | // import the first table "artists" |
| 44 | ImportSQLDatabaseWidget w; |
| 45 | w.loadSettings(); |
| 46 | w.setCustomQuery(false); |
| 47 | w.read(&spreadsheet, AbstractFileFilter::ImportMode::Replace); |
| 48 | |
| 49 | // check the spreadsheet size and columns names and modes |
| 50 | QCOMPARE(spreadsheet.rowCount(), 347); |
| 51 | QCOMPARE(spreadsheet.columnCount(), 3); |
| 52 | |
| 53 | QCOMPARE(spreadsheet.column(0)->name(), QLatin1String("AlbumId")); |
| 54 | QCOMPARE(spreadsheet.column(1)->name(), QLatin1String("Title")); |
| 55 | QCOMPARE(spreadsheet.column(2)->name(), QLatin1String("ArtistId")); |
| 56 | |
| 57 | QCOMPARE(spreadsheet.column(0)->columnMode(), AbstractColumn::ColumnMode::Integer); |
| 58 | QCOMPARE(spreadsheet.column(1)->columnMode(), AbstractColumn::ColumnMode::Text); |
| 59 | QCOMPARE(spreadsheet.column(2)->columnMode(), AbstractColumn::ColumnMode::Integer); |
| 60 | } |
| 61 | |
| 62 | /*! |
| 63 | * read the full table import in the append mode |
nothing calls this directly
no test coverage detected