Add basic tests for GetMajor/Minor HTTP versions in the response. (#5613)
* Add basic tests for GetMajor/Minor HTTP versions in the response. * Make the tests parameterized. * Address PR feedback - add more test cases.
This commit is contained in:
Родитель
6b5a8d1e36
Коммит
d895f82ef8
|
@ -121,6 +121,35 @@ namespace Azure { namespace Core { namespace Test {
|
|||
(std::pair<std::string, std::string>("valid3", "header3")));
|
||||
}
|
||||
|
||||
class ParameterizedTestForHttpVersions
|
||||
: public ::testing::TestWithParam<std::pair<std::int32_t, std::int32_t>> {
|
||||
protected:
|
||||
std::pair<std::int32_t, std::int32_t> httpVersion;
|
||||
};
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
TestHttp,
|
||||
ParameterizedTestForHttpVersions,
|
||||
::testing::Values(
|
||||
std::make_pair(0, 9),
|
||||
std::make_pair(1, 0),
|
||||
std::make_pair(1, 1),
|
||||
std::make_pair(1, 5),
|
||||
std::make_pair(2, 0),
|
||||
std::make_pair(INT32_MAX, 0),
|
||||
std::make_pair(INT32_MAX, INT32_MAX)));
|
||||
|
||||
TEST_P(ParameterizedTestForHttpVersions, ValidHttpVersionsInResponse)
|
||||
{
|
||||
std::int32_t majorVersion = GetParam().first;
|
||||
std::int32_t minorVersion = GetParam().second;
|
||||
|
||||
Http::RawResponse response(majorVersion, minorVersion, Http::HttpStatusCode::Ok, "Test");
|
||||
|
||||
EXPECT_EQ(response.GetMajorVersion(), majorVersion);
|
||||
EXPECT_EQ(response.GetMinorVersion(), minorVersion);
|
||||
}
|
||||
|
||||
// HTTP Range
|
||||
TEST(TestHttp, HttpRange)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче