Summary

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

Metrics

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

File(s)

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

#LineLine coverage
 1using System;
 2using Microsoft.Xrm.Sdk;
 3using Microsoft.Crm.Sdk.Messages;
 4using System.Reflection;
 5using System.Diagnostics;
 6
 7namespace FakeXrmEasy.FakeMessageExecutors
 8{
 9    public class RetrieveVersionRequestExecutor : IFakeMessageExecutor
 10    {
 11        public bool CanExecute(OrganizationRequest request)
 612        {
 613            return request is RetrieveVersionRequest;
 614        }
 15
 16        public OrganizationResponse Execute(OrganizationRequest request, XrmFakedContext ctx)
 617        {
 618            var assemblyPath = Assembly.GetAssembly(typeof(RetrieveVersionRequest)).Location;
 619            var versionInfo = FileVersionInfo.GetVersionInfo(assemblyPath);
 620            var version = versionInfo.FileVersion;
 21
 622            return new RetrieveVersionResponse
 623            {
 624                Results = new ParameterCollection
 625                {
 626                    { "Version", version }
 627                }
 628            };
 629        }
 30
 31        public Type GetResponsibleRequestType()
 426432        {
 426433            return typeof(RetrieveVersionRequest);
 426434        }
 35    }
 36}