< Summary

Class:DCL.ECSComponents.AnimatorRegister
Assembly:DCL.ECSComponents.Animator
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/ECS7/ECSComponents/Animator/AnimatorRegister.cs
Covered lines:10
Uncovered lines:0
Coverable lines:10
Total lines:28
Line coverage:100% (10 of 10)
Covered branches:0
Total branches:0

Metrics

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

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/ECS7/ECSComponents/Animator/AnimatorRegister.cs

#LineLine coverage
 1using System;
 2using DCL.ECSRuntime;
 3
 4namespace DCL.ECSComponents
 5{
 6    public class AnimatorRegister : IDisposable
 7    {
 8        private readonly ECSComponentsFactory factory;
 9        private readonly IECSComponentWriter componentWriter;
 10        private readonly int componentId;
 11
 2112        public AnimatorRegister(int componentId, ECSComponentsFactory factory, IECSComponentWriter componentWriter)
 13        {
 2114            factory.AddOrReplaceComponent(componentId, AnimatorSerializer.Deserialize, () => new AnimatorComponentHandle
 2115            componentWriter.AddOrReplaceComponentSerializer<PBAnimator>(componentId, AnimatorSerializer.Serialize);
 16
 2117            this.factory = factory;
 2118            this.componentWriter = componentWriter;
 2119            this.componentId = componentId;
 2120        }
 21
 22        public void Dispose()
 23        {
 224            factory.RemoveComponent(componentId);
 225            componentWriter.RemoveComponentSerializer(componentId);
 226        }
 27    }
 28}