2 #include <QtTest/QtTest>
7 #include <model/command/addframe.h>
8 #include <model/scene.h>
9 #include <model/layer.h>
10 #include <model/frame.h>
11 #include <common/inthash.h>
14 class TestAddFrame
: public QObject
22 void TestAddFrame::execute()
24 YAMF::Model::Project
*project
= new YAMF::Model::Project
;
25 YAMF::Model::Scene
*scene
= new YAMF::Model::Scene(project
);
26 YAMF::Model::Layer
*layer
= new YAMF::Model::Layer(scene
);
27 YAMF::Model::Frame
*frame
= new YAMF::Model::Frame(layer
);
29 YAMF::Common::IntHash
<YAMF::Model::Frame
*> frames
;
31 YAMF::Command::AddFrame
cmd(frame
, &frames
);
34 QCOMPARE(frames
.count(), 1 );
35 QVERIFY( frames
[0] == frame
);
44 void TestAddFrame::unexecute()
46 YAMF::Model::Project
*project
= new YAMF::Model::Project
;
47 YAMF::Model::Scene
*scene
= new YAMF::Model::Scene(project
);
48 YAMF::Model::Layer
*layer
= new YAMF::Model::Layer(scene
);
49 YAMF::Model::Frame
*frame
= new YAMF::Model::Frame(layer
);
51 YAMF::Common::IntHash
<YAMF::Model::Frame
*> frames
;
53 YAMF::Command::AddFrame
cmd(frame
, &frames
);
57 QCOMPARE(frames
.count(), 0 );
66 QTEST_MAIN(TestAddFrame
)
67 #include "test_addframe.moc"