Set description when converting MappingModel to IRespondWithAProvider (#1317)

Adding a mapping with a description to `WireMockServer.WithMapping`
did not include the description to the resulting
`IRespondWithAProvider`, which means that calling
`WireMockServer.SavePact` does not populate the description in the
contract file.

This PR includes the description when mapping from `MappingModel` to
`IRespondWithAProvider`.
This commit is contained in:
Dom Light
2025-06-14 10:13:04 +01:00
committed by GitHub
parent acd6592562
commit 70a9180af4
2 changed files with 11 additions and 2 deletions

View File

@@ -76,6 +76,11 @@ public partial class WireMockServer
respondProvider = respondProvider.WithTitle(mappingModel.Title!);
}
if (!string.IsNullOrEmpty(mappingModel.Description))
{
respondProvider = respondProvider.WithDescription(mappingModel.Description!);
}
if (mappingModel.Priority != null)
{
respondProvider = respondProvider.AtPriority(mappingModel.Priority.Value);