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
diff --git a/include/ut/http_utility_test.cpp b/include/ut/http_utility_test.cpp
index d091248..c92bf1e 100644
--- a/include/ut/http_utility_test.cpp
+++ b/include/ut/http_utility_test.cpp
@@ -7,15 +7,25 @@
namespace
{
-TEST(HttpUtility, requestPrefersHtml)
+TEST(RequestPrefersHtml, ContainsHtmlReturnsTrue)
+{
+ EXPECT_TRUE(requestPrefersHtml("text/html, application/json"));
+}
+
+TEST(RequestPrefersHtml, NoHtmlReturnsFalse)
{
EXPECT_FALSE(requestPrefersHtml("*/*, application/octet-stream"));
- EXPECT_TRUE(isOctetAccepted("*/*, application/octet-stream"));
-
- EXPECT_TRUE(requestPrefersHtml("text/html, application/json"));
- EXPECT_FALSE(isOctetAccepted("text/html, application/json"));
-
EXPECT_FALSE(requestPrefersHtml("application/json"));
+}
+
+TEST(IsOctetAccepted, ContainsOctetReturnsTrue)
+{
+ EXPECT_TRUE(isOctetAccepted("*/*, application/octet-stream"));
+}
+
+TEST(IsOctetAccepted, NoOctetReturnsFalse)
+{
+ EXPECT_FALSE(isOctetAccepted("text/html, application/json"));
EXPECT_FALSE(isOctetAccepted("application/json"));
}