diff options
author | Nan Zhou <nanzhoumails@gmail.com> | 2022-06-21 20:46:56 +0300 |
---|---|---|
committer | Nan Zhou <nanzhoumails@gmail.com> | 2022-06-28 20:20:21 +0300 |
commit | a02b586271bd419684f9e50e81675ed037ac8565 (patch) | |
tree | 395be0febb0f14a46def6ada88c89b00398c04be | |
parent | ad3edd4509a177497dd5bc3e3bcec83cfe56c57f (diff) | |
download | bmcweb-a02b586271bd419684f9e50e81675ed037ac8565.tar.xz |
http_utility_test: fix test case names
This commit applies the GTest test case naming convention: Camel case,
use decriptive Test names.
It also groups test cases according to the name.
Reference:
https://testing.googleblog.com/2014/10/testing-on-toilet-writing-descriptive.html
http://google.github.io/googletest/primer.html#simple-tests
Tested: unit test passes.
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: Ie008ceac9e027b518e660745722ac5cc0af502da
-rw-r--r-- | include/ut/http_utility_test.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/include/ut/http_utility_test.cpp b/include/ut/http_utility_test.cpp index d091248f89..c92bf1e4e5 100644 --- a/include/ut/http_utility_test.cpp +++ b/include/ut/http_utility_test.cpp @@ -7,15 +7,25 @@ namespace http_helpers namespace { -TEST(HttpUtility, requestPrefersHtml) +TEST(RequestPrefersHtml, ContainsHtmlReturnsTrue) +{ + EXPECT_TRUE(requestPrefersHtml("text/html, application/json")); +} + +TEST(RequestPrefersHtml, NoHtmlReturnsFalse) { EXPECT_FALSE(requestPrefersHtml("*/*, application/octet-stream")); + EXPECT_FALSE(requestPrefersHtml("application/json")); +} + +TEST(IsOctetAccepted, ContainsOctetReturnsTrue) +{ EXPECT_TRUE(isOctetAccepted("*/*, application/octet-stream")); +} - EXPECT_TRUE(requestPrefersHtml("text/html, application/json")); +TEST(IsOctetAccepted, NoOctetReturnsFalse) +{ EXPECT_FALSE(isOctetAccepted("text/html, application/json")); - - EXPECT_FALSE(requestPrefersHtml("application/json")); EXPECT_FALSE(isOctetAccepted("application/json")); } |