< Summary

Class:ScenesRefreshHelper
Assembly:BuilderProjectsPanel
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/BuilderProjectsPanel/Scripts/ScenesController/ScenesRefreshHelper.cs
Covered lines:13
Uncovered lines:9
Coverable lines:22
Total lines:53
Line coverage:59% (13 of 22)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Set(...)0%330100%
WasDeployedScene(...)0%220100%
WasProjectScene(...)0%220100%
IsSceneUpdate(...)0%220100%
IsSceneDeployStatusChanged(...)0%440100%
GetOldDictionary(...)0%12300%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/BuilderProjectsPanel/Scripts/ScenesController/ScenesRefreshHelper.cs

#LineLine coverage
 1using System.Collections.Generic;
 2
 3internal class ScenesRefreshHelper
 4{
 05    public Dictionary<string, ISceneCardView> oldDeployedScenes { get; private set; }
 06    public Dictionary<string, ISceneCardView> oldProjectsScenes { get; private set; }
 07    public bool isOldDeployedScenesEmpty { get; private set; }
 08    public bool isOldProjectScenesEmpty { get; private set; }
 9
 10    public void Set(Dictionary<string, ISceneCardView> oldDeployedScenes,
 11        Dictionary<string, ISceneCardView> oldProjectsScenes)
 12    {
 1213        this.oldDeployedScenes = oldDeployedScenes;
 1214        this.oldProjectsScenes = oldProjectsScenes;
 15
 1216        isOldDeployedScenesEmpty = oldDeployedScenes == null || oldDeployedScenes.Count == 0;
 1217        isOldProjectScenesEmpty = oldProjectsScenes == null || oldProjectsScenes.Count == 0;
 1218    }
 19
 20    public bool WasDeployedScene(ISceneData sceneData)
 21    {
 4922        if (isOldDeployedScenesEmpty)
 1023            return false;
 24
 3925        return oldDeployedScenes.ContainsKey(sceneData.id);
 26    }
 27
 28    public bool WasProjectScene(ISceneData sceneData)
 29    {
 2930        if (isOldProjectScenesEmpty)
 731            return false;
 32
 2233        return oldProjectsScenes.ContainsKey(sceneData.id);
 34    }
 35
 2236    public bool IsSceneUpdate(ISceneData sceneData) { return WasDeployedScene(sceneData) || WasProjectScene(sceneData); 
 37
 2538    public bool IsSceneDeployStatusChanged(ISceneData sceneData) { return (!sceneData.isDeployed && WasDeployedScene(sce
 39
 40    public Dictionary<string, ISceneCardView> GetOldDictionary(ISceneData sceneData)
 41    {
 042        if (WasDeployedScene(sceneData))
 43        {
 044            return oldDeployedScenes;
 45        }
 046        if (WasProjectScene(sceneData))
 47        {
 048            return oldProjectsScenes;
 49        }
 50
 051        return null;
 52    }
 53}