FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cppgraphqlgen/test/ResponseTests.cpp at main · wravery/cppgraphqlgen · GitHub
wravery
/
cppgraphqlgen
Public
forked from
microsoft/cppgraphqlgen
Notifications
You must be signed in to change notification settings
Fork
0
Star
2
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cppgraphqlgen
/
test
/
ResponseTests.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
35 lines (26 loc) · 1.02 KB
Breadcrumbs
cppgraphqlgen
/
test
/
ResponseTests.cpp
Copy path
File metadata and controls
35 lines (26 loc) · 1.02 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//
Copyright (c) Microsoft Corporation. All rights reserved.
//
Licensed under the MIT License.
#
include
<
gtest/gtest.h
>
#
include
"
graphqlservice/GraphQLResponse.h
"
using
namespace
graphql
;
TEST
(ResponseCase, ValueConstructorFromStringLiteral)
{
auto
expected =
"
Test String
"
;
auto
actual =
response::Value
(expected);
ASSERT_TRUE
(response::Type::String == actual.
type
());
ASSERT_EQ
(expected, actual.
release
<std::string>());
}
TEST
(ResponseCase, IdTypeCompareEqual)
{
const
auto
fakeId = []()
noexcept
{
std::string_view fakeIdString {
"
fakeId
"
};
response::IdType
result
(fakeIdString.
size
());
std::copy
(fakeIdString.
cbegin
(), fakeIdString.
cend
(), result.
begin
());
return
response::IdType {
std::move
(result) };
}();
EXPECT_TRUE
(response::IdType {
"
"
} < fakeId) <<
"
empty string should compare as less
"
;
EXPECT_TRUE
(fakeId < response::IdType {
"
invalid string
"
})
<<
"
an invalid string should compare as greater
"
;
EXPECT_TRUE
(fakeId == response::IdType {
"
ZmFrZUlk
"
})
<<
"
actual string should compare as equal
"
;
}
Back
|
FazBrowse Home
|
New Git URL