irregularity_test.cpp 881 Bytes
Newer Older
Matteo Spanio's avatar
update    
Matteo Spanio committed
1
2
#include "../src/lib/Irregularity.hpp"

Matteo's avatar
update  
Matteo committed
3
#include <gtest/gtest.h>
Matteo Spanio's avatar
update    
Matteo Spanio committed
4

Matteo's avatar
update  
Matteo committed
5
6
7
8
#include <boost/uuid/uuid.hpp>
#include <boost/uuid/uuid_generators.hpp>

TEST(Irregularity, Init) {
Matteo Spanio's avatar
update    
Matteo Spanio committed
9
10
    Irregularity irreg = Irregularity(Source::Video, "00:00:00.000", IrregularityType::WOW_AND_FLUTTER)
                             .set_image_URI("https://example.com/image.png");
Matteo's avatar
update  
Matteo committed
11

Matteo Spanio's avatar
update    
Matteo Spanio committed
12
13
    Irregularity irreg2 = Irregularity(Source::Video, "00:00:00.000", IrregularityType::WOW_AND_FLUTTER)
                              .set_image_URI("https://example.com/image.png");
Matteo's avatar
update  
Matteo committed
14

Matteo Spanio's avatar
update    
Matteo Spanio committed
15
16
17
18
19
20
    EXPECT_NE(irreg.get_id(), irreg2.get_id());
    EXPECT_EQ(irreg.get_source(), irreg2.get_source());
    EXPECT_EQ(irreg.get_time_label(), irreg2.get_time_label());
    EXPECT_EQ(irreg.get_type(), irreg2.get_type());
    EXPECT_EQ(irreg.get_image_URI(), irreg2.get_image_URI());
    EXPECT_EQ(irreg.get_audio_URI(), irreg2.get_audio_URI());
Matteo's avatar
update  
Matteo committed
21
}