< Summary

Information
Class: System.Net.HttpStatusDescription
Assembly: System.Net.Http
File(s): D:\runner\runtime\src\libraries\Common\src\System\Net\HttpStatusDescription.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 70
Coverable lines: 70
Total lines: 82
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 95
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
Get(...)100%110%
Get(...)0%95950%

File(s)

D:\runner\runtime\src\libraries\Common\src\System\Net\HttpStatusDescription.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4namespace System.Net
 5{
 6    internal static class HttpStatusDescription
 7    {
 8        internal static string? Get(HttpStatusCode code) =>
 09            Get((int)code);
 10
 11        internal static string? Get(int code) =>
 012            code switch
 013            {
 014                100 => "Continue",
 015                101 => "Switching Protocols",
 016                102 => "Processing",
 017                103 => "Early Hints",
 018
 019                200 => "OK",
 020                201 => "Created",
 021                202 => "Accepted",
 022                203 => "Non-Authoritative Information",
 023                204 => "No Content",
 024                205 => "Reset Content",
 025                206 => "Partial Content",
 026                207 => "Multi-Status",
 027                208 => "Already Reported",
 028                226 => "IM Used",
 029
 030                300 => "Multiple Choices",
 031                301 => "Moved Permanently",
 032                302 => "Found",
 033                303 => "See Other",
 034                304 => "Not Modified",
 035                305 => "Use Proxy",
 036                307 => "Temporary Redirect",
 037                308 => "Permanent Redirect",
 038
 039                400 => "Bad Request",
 040                401 => "Unauthorized",
 041                402 => "Payment Required",
 042                403 => "Forbidden",
 043                404 => "Not Found",
 044                405 => "Method Not Allowed",
 045                406 => "Not Acceptable",
 046                407 => "Proxy Authentication Required",
 047                408 => "Request Timeout",
 048                409 => "Conflict",
 049                410 => "Gone",
 050                411 => "Length Required",
 051                412 => "Precondition Failed",
 052                413 => "Request Entity Too Large",
 053                414 => "Request-Uri Too Long",
 054                415 => "Unsupported Media Type",
 055                416 => "Requested Range Not Satisfiable",
 056                417 => "Expectation Failed",
 057                421 => "Misdirected Request",
 058                422 => "Unprocessable Entity",
 059                423 => "Locked",
 060                424 => "Failed Dependency",
 061                426 => "Upgrade Required", // RFC 2817
 062                428 => "Precondition Required",
 063                429 => "Too Many Requests",
 064                431 => "Request Header Fields Too Large",
 065                451 => "Unavailable For Legal Reasons",
 066
 067                500 => "Internal Server Error",
 068                501 => "Not Implemented",
 069                502 => "Bad Gateway",
 070                503 => "Service Unavailable",
 071                504 => "Gateway Timeout",
 072                505 => "Http Version Not Supported",
 073                506 => "Variant Also Negotiates",
 074                507 => "Insufficient Storage",
 075                508 => "Loop Detected",
 076                510 => "Not Extended",
 077                511 => "Network Authentication Required",
 078
 079                _ => null,
 080            };
 81    }
 82}