< Summary

Class:GDX.Developer.ConsoleCommands.WaitConsoleCommand
Assembly:GDX
File(s):./Packages/com.dotbunny.gdx/GDX/Developer/ConsoleCommands/WaitConsoleCommand.cs
Covered lines:3
Uncovered lines:16
Coverable lines:19
Total lines:47
Line coverage:15.7% (3 of 19)
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%2100%
GetKeyword()0%110100%
GetHelpUsage()0%2100%
GetHelpMessage()0%2100%
GetInstance(...)0%2100%

File(s)

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

#LineLine coverage
 1// Copyright (c) 2020-2022 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 WaitConsoleCommand : ConsoleCommandBase
 9    {
 10        float m_WaitTime;
 11
 12        /// <inheritdoc />
 13        public override bool Evaluate(float deltaTime)
 014        {
 015            m_WaitTime -= deltaTime;
 016            return !(m_WaitTime > 0);
 017        }
 18
 19        /// <inheritdoc />
 20        public override string GetKeyword()
 721        {
 722            return "wait";
 723        }
 24
 25        /// <inheritdoc />
 26        public override string GetHelpUsage()
 027        {
 028            return "wait [seconds]";
 029        }
 30
 31        /// <inheritdoc />
 32        public override string GetHelpMessage()
 033        {
 034            return "Waits for a given period of time, till the next update if nothing is provided.";
 035        }
 36
 37        /// <inheritdoc />
 38        public override ConsoleCommandBase GetInstance(string context)
 039        {
 040            WaitConsoleCommand command = new WaitConsoleCommand();
 041            float.TryParse(context, out float result);
 042            command.m_WaitTime = result;
 043            return command;
 044        }
 45    }
 46#endif // UNITY_2022_2_OR_NEWER
 47}

Coverage by test methods







Methods/Properties

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