< Summary

Class:SmartItemParameterFactory
Assembly:BuilderInWorldEntityInformation
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/BuilderMode/EntityInformation/SmartItems/SmartItemParameterFactory.cs
Covered lines:0
Uncovered lines:2
Coverable lines:2
Total lines:25
Line coverage:0% (0 of 2)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
GetPrefab(...)0%6200%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/BuilderMode/EntityInformation/SmartItems/SmartItemParameterFactory.cs

#LineLine coverage
 1using DCL.Components;
 2using System;
 3using System.Collections;
 4using System.Collections.Generic;
 5using System.Linq;
 6using UnityEngine;
 7
 8[CreateAssetMenu(menuName = "Variables/SmartItemParameterFactory", fileName = "SmartItemParameterFactory", order = 0)]
 9public class SmartItemParameterFactory : ScriptableObject
 10{
 11    [Serializable]
 12    public class Entry
 13    {
 14        public SmartItemParameter.ParameterType type;
 15        public SmartItemUIParameterAdapter prefab;
 16    }
 17
 18    [SerializeField] private Entry[] entries;
 19
 20    public SmartItemUIParameterAdapter GetPrefab(SmartItemParameter.ParameterType type)
 21    {
 022        SmartItemUIParameterAdapter adapter = entries.FirstOrDefault(x => x.type == type)?.prefab;
 023        return adapter;
 24    }
 25}