< Summary

Class:DCL.Builder.SectionBase
Assembly:BuilderProjectsPanel
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/BuilderInWorld/HUD/ProjectsPanelHUD/Scripts/SectionController/SectionBase.cs
Covered lines:11
Uncovered lines:4
Coverable lines:15
Total lines:46
Line coverage:73.3% (11 of 15)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
SectionBase()0%110100%
OnFetchingStateChange(...)0%110100%
SetVisible(...)0%3.033085.71%
SetFetchingDataState(...)0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/BuilderInWorld/HUD/ProjectsPanelHUD/Scripts/SectionController/SectionBase.cs

#LineLine coverage
 1using System;
 2using UnityEngine;
 3
 4namespace DCL.Builder
 5{
 6    internal abstract class SectionBase : IDisposable
 7    {
 8        public Action OnEmptyContent;
 9        public Action OnNotEmptyContent;
 10
 011        public bool isVisible { get; private set; } = false;
 012        public virtual ISectionSearchHandler searchHandler { get; protected set; } = null;
 2713        public virtual SearchBarConfig searchBarConfig { get; protected set; } = new SearchBarConfig()
 14        {
 15            showFilterContributor = false,
 16            showFilterOperator = true,
 17            showFilterOwner = true,
 18            showResultLabel = true
 19        };
 020        public bool isLoading { get; private set; } = false;
 21
 22        public abstract void SetViewContainer(Transform viewContainer);
 23        public abstract void Dispose();
 24        protected abstract void OnShow();
 25        protected abstract void OnHide();
 526        protected virtual void OnFetchingStateChange(bool isLoading) { }
 27
 28        public void SetVisible(bool visible)
 29        {
 730            if (isVisible == visible)
 031                return;
 32
 733            isVisible = visible;
 734            if (visible)
 535                OnShow();
 36            else
 237                OnHide();
 238        }
 39
 40        public void SetFetchingDataState(bool isLoading)
 41        {
 542            this.isLoading = isLoading;
 543            OnFetchingStateChange(isLoading);
 544        }
 45    }
 46}