1
+ #include " unit.h"
2
+ #include " common/types.h"
3
+
4
+ class ProfileTest : public ::testing::Test
5
+ {
6
+ protected:
7
+ JsonEngine *jsonEngine;
8
+ Firebolt::Error error = Firebolt::Error::None;
9
+
10
+ void SetUp () override
11
+ {
12
+ jsonEngine = new JsonEngine ();
13
+ }
14
+
15
+ void TearDown () override
16
+ {
17
+ delete jsonEngine;
18
+ }
19
+ };
20
+
21
+ TEST_F (ProfileTest, ApproveContentRating)
22
+ {
23
+
24
+ nlohmann::json_abi_v3_11_3::json expectedValues = nlohmann::json::parse (jsonEngine->get_value (" Profile.approveContentRating" ));
25
+
26
+ bool status = Firebolt::IFireboltAccessor::Instance ().ProfileInterface ().approveContentRating (&error);
27
+
28
+ EXPECT_EQ (error, Firebolt::Error::None) << " Failed to retrieve status from Profile.approveContentRating() method" ;
29
+ EXPECT_EQ (status, expectedValues);
30
+ }
31
+
32
+ TEST_F (ProfileTest, ApprovePurchase)
33
+ {
34
+
35
+ nlohmann::json_abi_v3_11_3::json expectedValues = nlohmann::json::parse (jsonEngine->get_value (" Profile.approvePurchase" ));
36
+
37
+ bool status = Firebolt::IFireboltAccessor::Instance ().ProfileInterface ().approvePurchase (&error);
38
+
39
+ EXPECT_EQ (error, Firebolt::Error::None) << " Failed to retrieve status from Profile.approvePurchase() method" ;
40
+ EXPECT_EQ (status, expectedValues);
41
+ }
42
+
43
+ TEST_F (ProfileTest, Flags)
44
+ {
45
+
46
+ nlohmann::json_abi_v3_11_3::json expectedValues = nlohmann::json::parse (jsonEngine->get_value (" Profile.flags" ));
47
+
48
+ Firebolt::Types::FlatMap flag = Firebolt::IFireboltAccessor::Instance ().ProfileInterface ().flags (&error);
49
+
50
+ EXPECT_EQ (error, Firebolt::Error::None) << " Failed to retrieve flag from Profile.flags() method" ;
51
+ EXPECT_EQ (flag[" userExperience" ], expectedValues[" userExperience" ]);
52
+ }
0 commit comments