From 0db38862f96f5ab9c49c948fbf776a5924a430b7 Mon Sep 17 00:00:00 2001 From: Max Kerr Date: Wed, 7 Feb 2018 11:00:10 -0800 Subject: [PATCH] Remove an incorrect CookieParser test. (dotnet/corefx#26927) The test CookieParserGet_SetCookieHeaderValue_Success was written with an incorrect understanding of the desired behavior of CookieParser.Get(). The test was disabled when it was merged, and is fundamentally incorrect enough that it doesn't make sense to rewrite it. The relevant code is already covered by the regular cookie parsing tests. Fixes: dotnet/corefx#22925 Commit migrated from https://github.com/dotnet/corefx/commit/ff003980926913d799850233ea59b1ebee3ed837 --- .../tests/UnitTests/CookieInternalTest.cs | 28 ---------------------- 1 file changed, 28 deletions(-) diff --git a/src/libraries/System.Net.Primitives/tests/UnitTests/CookieInternalTest.cs b/src/libraries/System.Net.Primitives/tests/UnitTests/CookieInternalTest.cs index 35653d7..797fcf6 100644 --- a/src/libraries/System.Net.Primitives/tests/UnitTests/CookieInternalTest.cs +++ b/src/libraries/System.Net.Primitives/tests/UnitTests/CookieInternalTest.cs @@ -80,33 +80,5 @@ namespace NetPrimitivesUnitTests int expectedCookieCount = expectedStrings.Length >> 1; Assert.Equal(expectedCookieCount, cookieCount); } - - [ActiveIssue(22925)] - [Theory] - [InlineData("cookie_name=cookie_value", new[] { "cookie_name", "cookie_value" })] - [InlineData("cookie_name=cookie_value;", new[] { "cookie_name", "cookie_value" })] - [InlineData("cookie_name1=cookie_value1;cookie_name2=cookie_value2", new[] { "cookie_name1", "cookie_value1", "cookie_name2", "cookie_value2" })] - [InlineData("cookie_name1=cookie_value1;cookie_name2=cookie_value2;", new[] { "cookie_name1", "cookie_value1", "cookie_name2", "cookie_value2" })] - public void CookieParserGet_SetCookieHeaderValue_Success(string cookieString, string[] expectedStrings) - { - int index = 0; - int cookieCount = 0; - var parser = new CookieParser(cookieString); - while (true) - { - Cookie cookie = parser.Get(); - if (cookie == null) - { - break; - } - - cookieCount++; - Assert.Equal(expectedStrings[index++], cookie.Name); - Assert.Equal(expectedStrings[index++], cookie.Value); - } - - int expectedCookieCount = expectedStrings.Length >> 1; - Assert.Equal(expectedCookieCount, cookieCount); - } } } -- 2.7.4