userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
empty_from_json_test.cpp
1
#
include
<
gtest
/
gtest
.
h
>
2
3
#
include
<
string
>
4
5
#
include
<
userver
/
protobuf
/
json
/
convert
.
hpp
>
6
#
include
<
userver
/
utest
/
assert_macros
.
hpp
>
7
8
#
include
"utils.hpp"
9
10
USERVER_NAMESPACE_BEGIN
11
12
namespace
protobuf::json::tests {
13
14
class
EmptyFromJsonFailureTest :
public
::testing::TestWithParam<std::string> {};
15
INSTANTIATE_TEST_SUITE_P(, EmptyFromJsonFailureTest, ::
testing
::Values(
"[]"
,
"10"
,
"true"
,
"\"hello\""
));
16
17
TEST_P(EmptyFromJsonFailureTest, Test) {
18
const
auto
& param = GetParam();
19
20
proto_json::messages::EmptyMessage message;
21
formats::
json
::
Value
input = PrepareJsonTestData(param);
22
23
EXPECT_PARSE_ERROR
(
24
(
void
)JsonToMessage<proto_json::messages::EmptyMessage>(input),
25
ParseErrorCode
::
kInvalidType
,
26
"/"
27
);
28
UEXPECT_THROW
(InitSampleMessage(param, message),
SampleError
);
29
}
30
31
}
// namespace protobuf::json::tests
32
33
USERVER_NAMESPACE_END
protobuf
tests
json
empty_from_json_test.cpp
Generated on
for userver by
Doxygen
1.17.0