MCPcopy Create free account
hub / github.com/KDE/labplot / loadDateTimeFromProject

Method loadDateTimeFromProject

tests/backend/Column/ColumnTest.cpp:1005–1026  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1003}
1004
1005void ColumnTest::loadDateTimeFromProject() {
1006 Project project;
1007 project.load(QFINDTESTDATA(QLatin1String("data/Load.lml")));
1008
1009 auto* dateTimeSpreadsheet = project.child<AbstractAspect>(4);
1010 QVERIFY(dateTimeSpreadsheet != nullptr);
1011 QCOMPARE(dateTimeSpreadsheet->name(), QLatin1String("Datetime"));
1012 QCOMPARE(dateTimeSpreadsheet->type(), AspectType::Spreadsheet);
1013
1014 auto childs = dateTimeSpreadsheet->children(AspectType::Column);
1015 QVERIFY(childs.count() == 3);
1016 auto* dateTimeColumn = static_cast<Column*>(childs.at(0));
1017 QCOMPARE(dateTimeColumn->rowCount(), 8);
1018 // TODO:
1019 // auto* dayColumn = static_cast<Column*>(childs.at(1));
1020 // auto* monthColumn = static_cast<Column*>(childs.at(2));
1021
1022 // TODO: must be implemented
1023 // for (int i=0; i < 8; i++) {
1024 // QCOMPARE(dateTimeColumn->dateTimeAt(i), QDateTime::fromString("2022-01-12T12:30:24.920"));
1025 // }
1026}
1027
1028void ColumnTest::testIndexForValueStrictlyMonotonouslyRising() {
1029 Column c(QStringLiteral("Double column"), Column::ColumnMode::Double);

Callers

nothing calls this directly

Calls 6

loadMethod · 0.45
nameMethod · 0.45
typeMethod · 0.45
childrenMethod · 0.45
countMethod · 0.45
rowCountMethod · 0.45

Tested by

no test coverage detected