Adds further migration results and moves generated tests in
This commit is contained in:
442 files changed
+17126
-246
No files matched your search
@@ -0,0 +1,59 @@
|
||||
#include "Lts/Common/LtsTimelineClassic/Event.h"
|
||||
#include "Lts/Common/LtsTimelineClassic/EventGraphic.h"
|
||||
|
||||
#include <QPainter>
|
||||
#include <QRect>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
namespace LtsTimelineClassic
|
||||
{
|
||||
|
||||
class EventGraphicTest : public ::testing::Test
|
||||
{
|
||||
protected:
|
||||
void SetUp() override {}
|
||||
|
||||
void TearDown() override {}
|
||||
};
|
||||
|
||||
TEST(EventGraphicTest, ConstructorCreatesEventGraphic)
|
||||
{
|
||||
Event event(0, 100, Qt::red);
|
||||
EventGraphic graphic(&event);
|
||||
|
||||
EXPECT_FALSE(graphic.isMultipleEvent());
|
||||
EXPECT_EQ(graphic.eventList().size(), 1);
|
||||
}
|
||||
|
||||
TEST(EventGraphicTest, AddEventMakesItMultiple)
|
||||
{
|
||||
Event event1(0, 100, Qt::red);
|
||||
Event event2(50, 100, Qt::blue);
|
||||
EventGraphic graphic(&event1);
|
||||
|
||||
EXPECT_FALSE(graphic.isMultipleEvent());
|
||||
|
||||
graphic.addEvent(&event2);
|
||||
|
||||
EXPECT_TRUE(graphic.isMultipleEvent());
|
||||
EXPECT_EQ(graphic.eventList().size(), 2);
|
||||
}
|
||||
|
||||
TEST(EventGraphicTest, AddEventListMakesItMultiple)
|
||||
{
|
||||
Event event1(0, 100, Qt::red);
|
||||
Event event2(50, 100, Qt::blue);
|
||||
Event event3(100, 100, Qt::green);
|
||||
EventGraphic graphic(&event1);
|
||||
|
||||
QVector<Event*> additionalEvents;
|
||||
additionalEvents.append(&event2);
|
||||
additionalEvents.append(&event3);
|
||||
|
||||
graphic.addEventList(additionalEvents);
|
||||
|
||||
EXPECT_TRUE(graphic.isMultipleEvent());
|
||||
EXPECT_EQ(graphic.eventList().size(), 3);
|
||||
}
|
||||
|
||||
} // namespace LtsTimelineClassic
|
||||
Reference in new issue
Block a user