mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-24 10:01:00 +01:00
* Add TIOBE + include SonarAnalyzer.CSharp * . * cp * Copyright © WireMock.Net * more fixes * fix * xpath * if (Matchers == null || !Matchers.Any()) * if (Matchers != null) * ? * . * .
22 lines
541 B
C#
22 lines
541 B
C#
// Copyright © WireMock.Net
|
|
|
|
using WireMock.Admin.Mappings;
|
|
|
|
namespace WireMock.Extensions;
|
|
|
|
public static class ResponseModelExtensions
|
|
{
|
|
private const string DefaultStatusCode = "200";
|
|
|
|
public static string GetStatusCodeAsString(this ResponseModel response)
|
|
{
|
|
return response.StatusCode switch
|
|
{
|
|
string statusCodeAsString => statusCodeAsString,
|
|
|
|
int statusCodeAsInt => statusCodeAsInt.ToString(),
|
|
|
|
_ => response.StatusCode?.ToString() ?? DefaultStatusCode
|
|
};
|
|
}
|
|
} |