< Summary

Class:GDX.Developer.ConsoleCommands.WatchAllConsoleCommand
Assembly:GDX
File(s):./Packages/com.dotbunny.gdx/GDX/Developer/ConsoleCommands/WatchAllConsoleCommand.cs
Covered lines:3
Uncovered lines:23
Coverable lines:26
Total lines:59
Line coverage:11.5% (3 of 26)
Covered branches:0
Total branches:0
Covered methods:1
Total methods:5
Method coverage:20% (1 of 5)

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Evaluate(...)0%6200%
GetKeyword()0%110100%
GetHelpUsage()0%2100%
GetHelpMessage()0%2100%
GetInstance(...)0%6200%

File(s)

./Packages/com.dotbunny.gdx/GDX/Developer/ConsoleCommands/WatchAllConsoleCommand.cs

#LineLine coverage
 1// Copyright (c) 2020-2024 dotBunny Inc.
 2// dotBunny licenses this file to you under the BSL-1.0 license.
 3// See the LICENSE file in the project root for more information.
 4
 5namespace GDX.Developer.ConsoleCommands
 6{
 7#if UNITY_2022_2_OR_NEWER
 8    public class WatchAllConsoleCommand : ConsoleCommandBase
 9    {
 10        bool m_DesiredState;
 11
 12        public override bool Evaluate(float deltaTime)
 013        {
 014            if (m_DesiredState)
 015            {
 016                WatchProvider.SetAllEnabled();
 017            }
 18            else
 019            {
 020                WatchProvider.SetAllDisabled();
 021            }
 022            return true;
 023        }
 24
 25        /// <inheritdoc />
 26        public override string GetKeyword()
 727        {
 728            return "watch.all";
 729        }
 30
 31        /// <inheritdoc />
 32        public override string GetHelpUsage()
 033        {
 034            return "watch.all <state>";
 035        }
 36
 37        /// <inheritdoc />
 38        public override string GetHelpMessage()
 039        {
 040            return "Sets the state of all known watches.";
 041        }
 42
 43        /// <inheritdoc />
 44        public override ConsoleCommandBase GetInstance(string context)
 045        {
 046            if (string.IsNullOrEmpty(context))
 047            {
 048                UnityEngine.Debug.LogWarning($"A state must be given to apply to all watches.");
 049                return null;
 50            }
 51
 052            return new WatchAllConsoleCommand()
 53            {
 54                m_DesiredState =  context.IsBooleanPositiveValue()
 55            };
 056        }
 57    }
 58#endif // UNITY_2022_2_OR_NEWER
 59}

Coverage by test methods







Methods/Properties

Evaluate(System.Single)
GetKeyword()
GetHelpUsage()
GetHelpMessage()
GetInstance(System.String)