Summary

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

Metrics

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

File(s)

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

#LineLine coverage
 1using Microsoft.Xrm.Sdk;
 2using Microsoft.Xrm.Sdk.Messages;
 3using System;
 4
 5namespace FakeXrmEasy.FakeMessageExecutors
 6{
 7    public class CreateRequestExecutor : IFakeMessageExecutor
 8    {
 9        public bool CanExecute(OrganizationRequest request)
 15010        {
 15011            return request is CreateRequest;
 15012        }
 13
 14        public OrganizationResponse Execute(OrganizationRequest request, XrmFakedContext ctx)
 15015        {
 15016            var createRequest = (CreateRequest)request;
 17
 15018            var service = ctx.GetOrganizationService();
 19
 15020            var guid = service.Create(createRequest.Target);
 21
 12622            return new CreateResponse()
 12623            {
 12624                ResponseName = "Create",
 12625                Results = new ParameterCollection { { "id", guid } }
 12626            };
 12627        }
 28
 29        public Type GetResponsibleRequestType()
 426430        {
 426431            return typeof(CreateRequest);
 426432        }
 33    }
 34}