Skip to content

Tests for GetHttpProtocolVersion #14477

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions src/Shared/test/Shared.Tests/HttpSysGetHttpProtocolVersionTest.cs
Original file line number Diff line number Diff line change
@@ -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);
}
}
}