Summary

Class:FakeXrmEasy.Services.InvoiceInitializerService
Assembly:FakeXrmEasy
File(s):F:\Git\fake-xrm-easy\FakeXrmEasy.Shared\Services\EntityInitializer\InvoiceInitializerService.cs
Covered lines:7
Uncovered lines:3
Coverable lines:10
Total lines:28
Line coverage:70%
Branch coverage:50%

Metrics

MethodCyclomatic ComplexitySequence CoverageBranch Coverage
Initialize(...)210066.67
Initialize(...)100

File(s)

F:\Git\fake-xrm-easy\FakeXrmEasy.Shared\Services\EntityInitializer\InvoiceInitializerService.cs

#LineLine coverage
 1using Microsoft.Xrm.Sdk;
 2using System;
 3using System.Collections.Generic;
 4using System.Text;
 5
 6namespace FakeXrmEasy.Services
 7{
 8    public class InvoiceInitializerService : IEntityInitializerService
 9    {
 10        public const string EntityLogicalName = "invoice";
 11
 12        public Entity Initialize(Entity e, Guid gCallerId, XrmFakedContext ctx, bool isManyToManyRelationshipEntity = fa
 7213        {
 7214             if (string.IsNullOrEmpty(e.GetAttributeValue<string>("invoicenumber")))
 7215            {
 16                //first FakeXrmEasy auto-numbering emulation
 7217                e["invoicenumber"] = "INV-" + DateTime.Now.Ticks;
 7218            }
 19
 7220            return e;
 7221        }
 22
 23        public Entity Initialize(Entity e, XrmFakedContext ctx, bool isManyToManyRelationshipEntity = false)
 024        {
 025            return this.Initialize(e, Guid.NewGuid(), ctx, isManyToManyRelationshipEntity);
 026        }
 27    }
 28}