| | | 1 | | using Microsoft.Crm.Sdk.Messages; |
| | | 2 | | using Microsoft.Xrm.Sdk; |
| | | 3 | | using System; |
| | | 4 | | |
| | | 5 | | namespace FakeXrmEasy.FakeMessageExecutors |
| | | 6 | | { |
| | | 7 | | public class PublishXmlRequestExecutor : IFakeMessageExecutor |
| | | 8 | | { |
| | | 9 | | public bool CanExecute(OrganizationRequest request) |
| | 12 | 10 | | { |
| | 12 | 11 | | return request is PublishXmlRequest; |
| | 12 | 12 | | } |
| | | 13 | | |
| | | 14 | | public OrganizationResponse Execute(OrganizationRequest request, XrmFakedContext ctx) |
| | 12 | 15 | | { |
| | 12 | 16 | | var req = request as PublishXmlRequest; |
| | | 17 | | |
| | 12 | 18 | | if (string.IsNullOrWhiteSpace(req.ParameterXml)) |
| | 6 | 19 | | { |
| | 6 | 20 | | throw new Exception(string.Format("ParameterXml property must not be blank.")); |
| | | 21 | | } |
| | 6 | 22 | | return new PublishXmlResponse() |
| | 6 | 23 | | { |
| | 6 | 24 | | }; |
| | 6 | 25 | | } |
| | | 26 | | |
| | | 27 | | public Type GetResponsibleRequestType() |
| | 4270 | 28 | | { |
| | 4270 | 29 | | return typeof(PublishXmlRequest); |
| | 4270 | 30 | | } |
| | | 31 | | } |
| | | 32 | | } |