Summary

Class:FakeXrmEasy.FakeMessageExecutors.RemoveFromQueueRequestExecutor
Assembly:FakeXrmEasy
File(s):F:\Git\fake-xrm-easy\FakeXrmEasy.Shared\FakeMessageExecutors\RemoveFromQueueRequestExecutor.cs
Covered lines:16
Uncovered lines:0
Coverable lines:16
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\RemoveFromQueueRequestExecutor.cs

#LineLine coverage
 1#if FAKE_XRM_EASY_2013 || FAKE_XRM_EASY_2015 || FAKE_XRM_EASY_2016 || FAKE_XRM_EASY_365 || FAKE_XRM_EASY_9
 2
 3using Microsoft.Crm.Sdk.Messages;
 4using Microsoft.Xrm.Sdk;
 5using System;
 6using System.ServiceModel;
 7
 8namespace FakeXrmEasy.FakeMessageExecutors
 9{
 10    public class RemoveFromQueueRequestExecutor : IFakeMessageExecutor
 11    {
 12        public bool CanExecute(OrganizationRequest request)
 513        {
 514            return request is RemoveFromQueueRequest;
 515        }
 16
 17        public OrganizationResponse Execute(OrganizationRequest request, XrmFakedContext ctx)
 1018        {
 1019            var removeFromQueueRequest = (RemoveFromQueueRequest)request;
 20
 1021            var queueItemId = removeFromQueueRequest.QueueItemId;
 1022             if (queueItemId == Guid.Empty)
 523            {
 524                throw new FaultException<OrganizationServiceFault>(new OrganizationServiceFault(), "Cannot remove withou
 25            }
 26
 527            var service = ctx.GetOrganizationService();
 528            service.Delete("queueitem", queueItemId);
 29
 530            return new RemoveFromQueueResponse();
 531        }
 32
 33        public Type GetResponsibleRequestType()
 359234        {
 359235            return typeof(RemoveFromQueueRequest);
 359236        }
 37    }
 38}
 39#endif