Folder restructuring of test projects.
This commit is contained in:
parent
a79357db87
commit
c23282cc7a
13 changed files with 33 additions and 35 deletions
29
tests/pglabtests/tst_ParamJson.cpp
Normal file
29
tests/pglabtests/tst_ParamJson.cpp
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#include <gtest/gtest.h>
|
||||
#include <gmock/gmock-matchers.h>
|
||||
#include "ParamListModel.h"
|
||||
#include "ParamListJson.h"
|
||||
|
||||
using namespace testing;
|
||||
|
||||
|
||||
TEST(ParamListToJson, test1)
|
||||
{
|
||||
t_ParamList params;
|
||||
params.emplace_back("valuestr", "typestr");
|
||||
|
||||
Json::Value root = ParamListToJson(params); // will contains the root value after parsing.
|
||||
ASSERT_TRUE(root.isArray());
|
||||
ASSERT_EQ(root.size(), 1);
|
||||
|
||||
Json::Value e = root[0];
|
||||
ASSERT_TRUE(e.isMember("type"));
|
||||
ASSERT_TRUE(e.isMember("value"));
|
||||
ASSERT_EQ(e["type"].asString(), "typestr");
|
||||
ASSERT_EQ(e["value"].asString(), "valuestr");
|
||||
// Json::Reader reader;
|
||||
// bool parsingSuccessful = reader.parse(input, root);
|
||||
// auto explain = ExplainRoot::createFromJson(root);
|
||||
|
||||
// ASSERT_TRUE(explain != nullptr);
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue