mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-18 07:24:34 +01:00
Refactor some code (IBodyDataExtensions)
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
using WireMock.Types;
|
||||
// Copyright © WireMock.Net
|
||||
|
||||
using WireMock.Types;
|
||||
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace WireMock.Util;
|
||||
|
||||
public static class IBodyDataExtension
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public static class IBodyDataExtensions
|
||||
{
|
||||
public static BodyType GetBodyType(this IBodyData bodyData)
|
||||
{
|
||||
@@ -11,10 +14,12 @@ public static class IBodyDataExtension
|
||||
{
|
||||
return bodyData.DetectedBodyTypeFromContentType.Value;
|
||||
}
|
||||
|
||||
if (bodyData.DetectedBodyType is not null and not BodyType.None)
|
||||
{
|
||||
return bodyData.DetectedBodyType.Value;
|
||||
}
|
||||
|
||||
return BodyType.None;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user