Tests for GetHttpProtocolVersion (#14477)

This commit is contained in:
Günther Foidl 2019-10-08 19:48:59 +02:00 committed by Justin Kotalik
parent c685c327ed
commit 53a54d9f91
1 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,29 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Xunit;
namespace Microsoft.AspNetCore.HttpSys.Internal
{
public class HttpSysGetHttpProtocolVersionTest
{
public static TheoryData<Version, string> s_data = new TheoryData<Version, string>
{
{ new Version(2, 0), "HTTP/2" },
{ new Version(1, 1), "HTTP/1.1" },
{ new Version(1, 0), "HTTP/1.0" },
{ new Version(0, 3), "HTTP/0.3" },
{ new Version(2, 1), "HTTP/2.1" }
};
[Theory]
[MemberData(nameof(s_data))]
public void GetHttpProtocolVersion_CorrectIETFVersion(Version version, string expected)
{
var actual = version.GetHttpProtocolVersion();
Assert.Equal(expected, actual);
}
}
}