< Summary

Class:DCL.ECSComponents.ECSTextShapeRegister
Assembly:DCL.ECSComponents.TextShape
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/ECS7/ECSComponents/TextShape/ECSTextShapeRegister.cs
Covered lines:10
Uncovered lines:1
Coverable lines:11
Total lines:30
Line coverage:90.9% (10 of 11)
Covered branches:0
Total branches:0

Metrics

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

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/ECS7/ECSComponents/TextShape/ECSTextShapeRegister.cs

#LineLine coverage
 1using System;
 2using DCL.ECSRuntime;
 3
 4namespace DCL.ECSComponents
 5{
 6    public class ECSTextShapeRegister : IDisposable
 7    {
 8        private readonly ECSComponentsFactory factory;
 9        private readonly IECSComponentWriter componentWriter;
 10        private readonly int componentId;
 11
 2112        public ECSTextShapeRegister(int componentId, ECSComponentsFactory factory, IECSComponentWriter componentWriter,
 13            IInternalECSComponents internalComponents)
 14        {
 2115            factory.AddOrReplaceComponent(componentId, ProtoSerialization.Deserialize<PBTextShape>,
 016                () => new ECSTextShapeComponentHandler(AssetPromiseKeeper_Font.i, internalComponents.renderersComponent)
 2117            componentWriter.AddOrReplaceComponentSerializer<PBTextShape>(componentId, ProtoSerialization.Serialize);
 18
 2119            this.factory = factory;
 2120            this.componentWriter = componentWriter;
 2121            this.componentId = componentId;
 2122        }
 23
 24        public void Dispose()
 25        {
 226            factory.RemoveComponent(componentId);
 227            componentWriter.RemoveComponentSerializer(componentId);
 228        }
 29    }
 30}