< Summary

Class:GDX.Developer.ConsoleCommands.SceneListConsoleCommand
Assembly:GDX
File(s):./Packages/com.dotbunny.gdx/GDX/Developer/ConsoleCommands/SceneListConsoleCommand.cs
Covered lines:3
Uncovered lines:17
Coverable lines:20
Total lines:44
Line coverage:15% (3 of 20)
Covered branches:0
Total branches:0
Covered methods:1
Total methods:3
Method coverage:33.3% (1 of 3)

Coverage History

Metrics

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

File(s)

./Packages/com.dotbunny.gdx/GDX/Developer/ConsoleCommands/SceneListConsoleCommand.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
 5using UnityEngine;
 6using UnityEngine.SceneManagement;
 7
 8namespace GDX.Developer.ConsoleCommands
 9{
 10#if UNITY_2022_2_OR_NEWER
 11    public class SceneListConsoleCommand : ConsoleCommandBase
 12    {
 13        /// <inheritdoc />
 14        public override bool Evaluate(float deltaTime)
 015        {
 016            TextGenerator textGenerator = new TextGenerator();
 017            int sceneCount = SceneManager.sceneCountInBuildSettings;
 018            for (int i = 0; i < sceneCount; i++)
 019            {
 020                Scene scene = SceneManager.GetSceneByBuildIndex(i);
 021                if (scene.IsValid())
 022                {
 023                    textGenerator.AppendLine($"{i}\t\t{scene.name}");
 024                }
 025            }
 26
 027            Debug.Log(textGenerator.ToString());
 028            return true;
 029        }
 30
 31        /// <inheritdoc />
 32        public override string GetKeyword()
 733        {
 734            return "scene.list";
 735        }
 36
 37        /// <inheritdoc />
 38        public override string GetHelpMessage()
 039        {
 040            return "Displays a list of known scenes in the build.";
 041        }
 42    }
 43#endif // UNITY_2022_2_OR_NEWER
 44}

Coverage by test methods







Methods/Properties

Evaluate(System.Single)
GetKeyword()
GetHelpMessage()