/** * Unittest for testing the statemachine for aes objects * $Id$ * $HeadURL$ * $Author$ */ #pragma once #include namespace AreaEffectSimulation { class DummyAesObject final: public ObjectBaseTmpl { Q_OBJECT public: explicit DummyAesObject(QObject *parent = nullptr); void setAesEffectState(AesEffectState newState) { m_data.effectStateId = newState; } void setSupportsPausing(bool bSupportsPausing) { m_bSupportsPausing = bSupportsPausing; } void setActivationTime(time_t actTime) { if (actTime) m_data.effectStart = QDateTime::fromMSecsSinceEpoch(actTime * 1000LL); else m_data.effectStart = QDateTime(); } void setDurationSec(int durationSec) { m_data.effectDuration = durationSec * 1000; } qint64 partitionTimeMSec() const override { return partitionTime().toMSecsSinceEpoch(); } QDateTime partitionTime() const override { return QDateTime::currentDateTimeUtc(); } std::vector form() const override { return {}; } QPolygonF generateForm() override; AesType aesType() const override { return AesType::AtUnknown; } bool isCentral() const override { return m_data.isCentral; } }; class StateMachineTest : public QObject { Q_OBJECT public: StateMachineTest(); ~StateMachineTest(); private Q_SLOTS: void staticTests(); void dynamicTests(); private: DummyAesObject *m_dummyAesObject; }; } // namespace AreaEffectSimulation