< Summary

Class:FriendsListToggleButton
Assembly:FriendsHUD
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/FriendsHUD/Scripts/Misc/FriendsListToggleButton.cs
Covered lines:8
Uncovered lines:0
Coverable lines:8
Total lines:26
Line coverage:100% (8 of 8)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Awake()0%220100%
Toggle()0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/FriendsHUD/Scripts/Misc/FriendsListToggleButton.cs

#LineLine coverage
 1using DCL.Helpers;
 2using UnityEngine;
 3using UnityEngine.UI;
 4
 5public class FriendsListToggleButton : MonoBehaviour
 6{
 7    public bool toggleOnAwake = false;
 8    public Button toggleButton;
 9    public Transform toggleButtonIcon;
 10    public RectTransform containerRectTransform;
 11
 12    void Awake()
 13    {
 1314        toggleButton.onClick.AddListener(Toggle);
 15
 1316        if (toggleOnAwake)
 1317            Toggle();
 1318    }
 19
 20    void Toggle()
 21    {
 1322        containerRectTransform.gameObject.SetActive(!containerRectTransform.gameObject.activeSelf);
 1323        toggleButtonIcon.localScale = new Vector3(toggleButtonIcon.localScale.x, -toggleButtonIcon.localScale.y, 1f);
 1324        Utils.ForceRebuildLayoutImmediate(containerRectTransform);
 1325    }
 26}

Methods/Properties

Awake()
Toggle()