< Summary

Class:DCL.ECSComponents.NFTShapeRegister
Assembly:DCL.ECSComponents.NFTShape
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/ECS7/ECSComponents/NFTShape/NFTShapeRegister.cs
Covered lines:11
Uncovered lines:1
Coverable lines:12
Total lines:33
Line coverage:91.6% (11 of 12)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
NFTShapeRegister(...)0%110100%
Dispose()0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/ECS7/ECSComponents/NFTShape/NFTShapeRegister.cs

#LineLine coverage
 1using DCL.ECSRuntime;
 2using UnityEngine;
 3
 4namespace DCL.ECSComponents
 5{
 6    public class NFTShapeRegister
 7    {
 8        private readonly ECSComponentsFactory factory;
 9        private readonly IECSComponentWriter componentWriter;
 10        private readonly int componentId;
 11
 2112        public NFTShapeRegister(int componentId, ECSComponentsFactory factory, IECSComponentWriter componentWriter, IInt
 13        {
 2114            var shapeFrameFactory = Resources.Load<NFTShapeFrameFactory>("NFTShapeFrameFactory");
 2115            factory.AddOrReplaceComponent(componentId, ProtoSerialization.Deserialize<PBNftShape>,
 016                () => new ECSNFTShapeComponentHandler(shapeFrameFactory,
 17                    new NFTInfoRetriever(),
 18                    new NFTAssetRetriever(),
 19                    internalComponents.renderersComponent));
 2120            componentWriter.AddOrReplaceComponentSerializer<PBNftShape>(componentId, ProtoSerialization.Serialize);
 21
 2122            this.factory = factory;
 2123            this.componentWriter = componentWriter;
 2124            this.componentId = componentId;
 2125        }
 26
 27        public void Dispose()
 28        {
 229            factory.RemoveComponent(componentId);
 230            componentWriter.RemoveComponentSerializer(componentId);
 231        }
 32    }
 33}