mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-25 02:21:00 +01:00
Add support for Faults (#360)
* FaultType - wip * . * copy fault * tests * code-factor * more tests * fix tests * fixed * remove RANDOM_DATA_THEN_CLOSE
This commit is contained in:
@@ -114,6 +114,7 @@ namespace WireMock.Serialization
|
||||
mappingModel.Response.UseTransformer = null;
|
||||
mappingModel.Response.BodyEncoding = null;
|
||||
mappingModel.Response.ProxyUrl = response.ProxyUrl;
|
||||
mappingModel.Response.Fault = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -161,6 +162,15 @@ namespace WireMock.Serialization
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
if (response.ResponseMessage.FaultType != FaultType.NONE)
|
||||
{
|
||||
mappingModel.Response.Fault = new FaultModel
|
||||
{
|
||||
Type = response.ResponseMessage.FaultType.ToString(),
|
||||
Percentage = response.ResponseMessage.FaultPercentage
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return mappingModel;
|
||||
|
||||
Reference in New Issue
Block a user