Skip to content

Commit

Permalink
Options UT (#5249)
Browse files Browse the repository at this point in the history
* Options Http Enum add

* spaces

* options UT

* remove Options

* Revert "remove Options"

This reverts commit 0da5d2c.
  • Loading branch information
gearama authored Jan 11, 2024
1 parent 88242f3 commit e69559f
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions sdk/core/azure-core/test/ut/http_method_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ TEST(HttpMethod, Get)
EXPECT_NE(get, HttpMethod::Delete);
EXPECT_NE(get, HttpMethod::Patch);
EXPECT_NE(get, HttpMethod("TRACE"));
EXPECT_NE(get, HttpMethod::Options);
EXPECT_NE(get, HttpMethod("HUMUHUMUNUKUNUKUAPUAA"));

EXPECT_NE(HttpMethod::Head, get);
Expand All @@ -42,6 +43,7 @@ TEST(HttpMethod, Get)
EXPECT_NE(HttpMethod::Delete, get);
EXPECT_NE(HttpMethod::Patch, get);
EXPECT_NE(HttpMethod("TRACE"), get);
EXPECT_NE(HttpMethod::Options, get);
EXPECT_NE(HttpMethod("HUMUHUMUNUKUNUKUAPUAA"), get);
}

Expand Down Expand Up @@ -70,6 +72,7 @@ TEST(HttpMethod, Head)
EXPECT_NE(head, HttpMethod::Delete);
EXPECT_NE(head, HttpMethod::Patch);
EXPECT_NE(head, HttpMethod("TRACE"));
EXPECT_NE(head, HttpMethod::Options);
EXPECT_NE(head, HttpMethod("HUMUHUMUNUKUNUKUAPUAA"));

EXPECT_NE(HttpMethod::Get, head);
Expand All @@ -78,6 +81,7 @@ TEST(HttpMethod, Head)
EXPECT_NE(HttpMethod::Delete, head);
EXPECT_NE(HttpMethod::Patch, head);
EXPECT_NE(HttpMethod("TRACE"), head);
EXPECT_NE(HttpMethod::Options, head);
EXPECT_NE(HttpMethod("HUMUHUMUNUKUNUKUAPUAA"), head);
}

Expand Down Expand Up @@ -106,6 +110,7 @@ TEST(HttpMethod, Post)
EXPECT_NE(post, HttpMethod::Delete);
EXPECT_NE(post, HttpMethod::Patch);
EXPECT_NE(post, HttpMethod("TRACE"));
EXPECT_NE(post, HttpMethod::Options);
EXPECT_NE(post, HttpMethod("HUMUHUMUNUKUNUKUAPUAA"));

EXPECT_NE(HttpMethod::Get, post);
Expand All @@ -114,6 +119,7 @@ TEST(HttpMethod, Post)
EXPECT_NE(HttpMethod::Delete, post);
EXPECT_NE(HttpMethod::Patch, post);
EXPECT_NE(HttpMethod("TRACE"), post);
EXPECT_NE(HttpMethod::Options, post);
EXPECT_NE(HttpMethod("HUMUHUMUNUKUNUKUAPUAA"), post);
}

Expand Down Expand Up @@ -142,6 +148,7 @@ TEST(HttpMethod, Put)
EXPECT_NE(put, HttpMethod::Delete);
EXPECT_NE(put, HttpMethod::Patch);
EXPECT_NE(put, HttpMethod("TRACE"));
EXPECT_NE(put, HttpMethod::Options);
EXPECT_NE(put, HttpMethod("HUMUHUMUNUKUNUKUAPUAA"));

EXPECT_NE(HttpMethod::Get, put);
Expand All @@ -150,6 +157,7 @@ TEST(HttpMethod, Put)
EXPECT_NE(HttpMethod::Delete, put);
EXPECT_NE(HttpMethod::Patch, put);
EXPECT_NE(HttpMethod("TRACE"), put);
EXPECT_NE(HttpMethod::Options, put);
EXPECT_NE(HttpMethod("HUMUHUMUNUKUNUKUAPUAA"), put);
}

Expand Down Expand Up @@ -178,6 +186,7 @@ TEST(HttpMethod, Delete)
EXPECT_NE(delete_, HttpMethod::Put);
EXPECT_NE(delete_, HttpMethod::Patch);
EXPECT_NE(delete_, HttpMethod("TRACE"));
EXPECT_NE(delete_, HttpMethod::Options);
EXPECT_NE(delete_, HttpMethod("HUMUHUMUNUKUNUKUAPUAA"));

EXPECT_NE(HttpMethod::Get, delete_);
Expand All @@ -186,6 +195,7 @@ TEST(HttpMethod, Delete)
EXPECT_NE(HttpMethod::Put, delete_);
EXPECT_NE(HttpMethod::Patch, delete_);
EXPECT_NE(HttpMethod("TRACE"), delete_);
EXPECT_NE(HttpMethod::Options, delete_);
EXPECT_NE(HttpMethod("HUMUHUMUNUKUNUKUAPUAA"), delete_);
}

Expand Down Expand Up @@ -213,6 +223,7 @@ TEST(HttpMethod, Patch)
EXPECT_NE(patch, HttpMethod::Post);
EXPECT_NE(patch, HttpMethod::Put);
EXPECT_NE(patch, HttpMethod::Delete);
EXPECT_NE(patch, HttpMethod::Options);
EXPECT_NE(patch, HttpMethod("TRACE"));
EXPECT_NE(patch, HttpMethod("HUMUHUMUNUKUNUKUAPUAA"));

Expand All @@ -221,6 +232,7 @@ TEST(HttpMethod, Patch)
EXPECT_NE(HttpMethod::Post, patch);
EXPECT_NE(HttpMethod::Put, patch);
EXPECT_NE(HttpMethod::Delete, patch);
EXPECT_NE(HttpMethod::Options, patch);
EXPECT_NE(HttpMethod("TRACE"), patch);
EXPECT_NE(HttpMethod("HUMUHUMUNUKUNUKUAPUAA"), patch);
}
Expand Down Expand Up @@ -254,9 +266,46 @@ TEST(HttpMethod, Trace)
EXPECT_NE(HttpMethod::Put, trace);
EXPECT_NE(HttpMethod::Delete, trace);
EXPECT_NE(HttpMethod::Patch, trace);
EXPECT_NE(HttpMethod::Options, trace);
EXPECT_NE(HttpMethod("HUMUHUMUNUKUNUKUAPUAA"), trace);
}

TEST(HttpMethod, Options)
{
HttpMethod const options = HttpMethod("OPTIONS");
EXPECT_EQ(options.ToString(), "OPTIONS");

EXPECT_EQ(options, options);
EXPECT_EQ(options, HttpMethod("OPTIONS"));
EXPECT_EQ(HttpMethod("OPTIONS"), options);

EXPECT_NE(options, HttpMethod("Options"));
EXPECT_NE(HttpMethod("Options"), options);

EXPECT_NE(options, HttpMethod(std::string()));
EXPECT_NE(HttpMethod(std::string()), options);

EXPECT_EQ(options, HttpMethod::Options);

EXPECT_NE(options, HttpMethod::Get);
EXPECT_NE(options, HttpMethod::Head);
EXPECT_NE(options, HttpMethod::Post);
EXPECT_NE(options, HttpMethod::Put);
EXPECT_NE(options, HttpMethod::Delete);
EXPECT_NE(options, HttpMethod::Patch);
EXPECT_NE(options, HttpMethod("TRACE"));
EXPECT_NE(options, HttpMethod("HUMUHUMUNUKUNUKUAPUAA"));

EXPECT_NE(HttpMethod::Get, options);
EXPECT_NE(HttpMethod::Head, options);
EXPECT_NE(HttpMethod::Post, options);
EXPECT_NE(HttpMethod::Put, options);
EXPECT_NE(HttpMethod::Delete, options);
EXPECT_NE(HttpMethod::Patch, options);
EXPECT_NE(HttpMethod("TRACE"), options);
EXPECT_NE(HttpMethod("HUMUHUMUNUKUNUKUAPUAA"), options);
}

TEST(HttpMethod, HawaiianFish)
{
HttpMethod const humuhumunukunukuapuaa = HttpMethod("HUMUHUMUNUKUNUKUAPUAA");
Expand Down

0 comments on commit e69559f

Please sign in to comment.