MCPcopy Create free account
hub / github.com/NPP-JSONViewer/JSON-Viewer / TEST_F

Function TEST_F

tests/UnitTest/JsonSortByKeyTest.cpp:21–28  ·  view source on GitHub ↗

Test SortJsonByKey

Source from the content-addressed store, hash-verified

19
20 // Test SortJsonByKey
21 TEST_F(JsonSortByKeyTest, TestSortJsonByKey_Success)
22 {
23 std::string inputJson = R"({"b": "valueB", "a": "valueA"})";
24 auto result = m_jsonHandler.SortJsonByKey(inputJson, {}, {}, ' ', 4);
25
26 ASSERT_TRUE(result.success);
27 ASSERT_EQ(result.response, "{\n \"a\": \"valueA\",\n \"b\": \"valueB\"\n}");
28 }
29
30 TEST_F(JsonSortByKeyTest, TestSortJsonByKey_InvalidJson)
31 {

Callers

nothing calls this directly

Calls 1

SortJsonByKeyMethod · 0.45

Tested by

no test coverage detected