Files
WireMock.Net-wiremock/src/WireMock.Net.Abstractions/Extensions/ResponseModelExtensions.cs
Stef Heyenrath 5e301fd74b Swagger support (#749)
* r

* fix

* sw

* x

* s

* .

* .

* .

* CreateTypeFromJObject

* .

* .

* f

* c

* .

* .

* .

* .

* .

* .

* ok

* ,

* .

* .

* .

* .

* n

* pact

* fix

* schema

* null

* fluent

* r

* -p

* .

* .

* refs

* .
2022-05-13 22:01:46 +02:00

20 lines
511 B
C#

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
};
}
}