Skip to content

Commit 53a54d9

Browse files
gfoidljkotalik
authored andcommitted
Tests for GetHttpProtocolVersion (#14477)
1 parent c685c32 commit 53a54d9

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright (c) .NET Foundation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
4+
using System;
5+
using Xunit;
6+
7+
namespace Microsoft.AspNetCore.HttpSys.Internal
8+
{
9+
public class HttpSysGetHttpProtocolVersionTest
10+
{
11+
public static TheoryData<Version, string> s_data = new TheoryData<Version, string>
12+
{
13+
{ new Version(2, 0), "HTTP/2" },
14+
{ new Version(1, 1), "HTTP/1.1" },
15+
{ new Version(1, 0), "HTTP/1.0" },
16+
{ new Version(0, 3), "HTTP/0.3" },
17+
{ new Version(2, 1), "HTTP/2.1" }
18+
};
19+
20+
[Theory]
21+
[MemberData(nameof(s_data))]
22+
public void GetHttpProtocolVersion_CorrectIETFVersion(Version version, string expected)
23+
{
24+
var actual = version.GetHttpProtocolVersion();
25+
26+
Assert.Equal(expected, actual);
27+
}
28+
}
29+
}

0 commit comments

Comments
 (0)