Summary

Class:FakeXrmEasy.FakeMessageExecutors.DeleteRequestExecutor
Assembly:FakeXrmEasy
File(s):F:\Git\fake-xrm-easy\FakeXrmEasy.Shared\FakeMessageExecutors\DeleteRequestExecutor.cs
Covered lines:17
Uncovered lines:0
Coverable lines:17
Total lines:39
Line coverage:100%
Branch coverage:100%

Metrics

MethodCyclomatic ComplexitySequence CoverageBranch Coverage
CanExecute(...)1100100
Execute(...)2100100
GetResponsibleRequestType()1100100

File(s)

F:\Git\fake-xrm-easy\FakeXrmEasy.Shared\FakeMessageExecutors\DeleteRequestExecutor.cs

#LineLine coverage
 1using Microsoft.Xrm.Sdk;
 2using Microsoft.Xrm.Sdk.Messages;
 3using System;
 4using System.ServiceModel;
 5
 6namespace FakeXrmEasy.FakeMessageExecutors
 7{
 8    public class DeleteRequestExecutor : IFakeMessageExecutor
 9    {
 10        public bool CanExecute(OrganizationRequest request)
 1511        {
 1512            return request is DeleteRequest;
 1513        }
 14
 15        public OrganizationResponse Execute(OrganizationRequest request, XrmFakedContext ctx)
 1516        {
 1517            var deleteRequest = (DeleteRequest)request;
 18
 1519            var target = deleteRequest.Target;
 20
 1521             if (target == null)
 622            {
 623                throw new FaultException<OrganizationServiceFault>(new OrganizationServiceFault(), "Can not delete witho
 24            }
 25
 926            var targetId = ctx.GetRecordUniqueId(target);
 27
 928            var service = ctx.GetOrganizationService();
 929            service.Delete(target.LogicalName, targetId);
 30
 931            return new DeleteResponse();
 932        }
 33
 34        public Type GetResponsibleRequestType()
 426435        {
 426436            return typeof(DeleteRequest);
 426437        }
 38    }
 39}