< Summary

Class:GDX.Developer.ConsoleLogEntry
Assembly:GDX
File(s):./Packages/com.dotbunny.gdx/GDX/Developer/ConsoleLogEntry.cs
Covered lines:7
Uncovered lines:18
Coverable lines:25
Total lines:59
Line coverage:28% (7 of 25)
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
ConsoleLogEntry(...)0%110100%
CompareTo(...)0%12300%
Compare(...)0%12300%

File(s)

./Packages/com.dotbunny.gdx/GDX/Developer/ConsoleLogEntry.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
 5using System;
 6using System.Collections.Generic;
 7using UnityEngine;
 8
 9namespace GDX.Developer
 10{
 11    public struct ConsoleLogEntry : IComparable<ConsoleLogEntry>, IComparer<ConsoleLogEntry>
 12    {
 13        public int Frame;
 14        public string FrameCount;
 15        public LogType Level;
 16        public string Message;
 17        public string StackTrace;
 18
 19        public ConsoleLogEntry(LogType type, string message, string stackTrace = null)
 1320        {
 1321            Frame = Time.frameCount;
 1322            FrameCount = Frame.ToString().PadLeft(10, '0');
 1323            Level = type;
 1324            Message = message;
 1325            StackTrace = stackTrace;
 1326        }
 27
 28        public int CompareTo(ConsoleLogEntry other)
 029        {
 30
 031            if (Frame > other.Frame)
 032            {
 033                return 1;
 34            }
 35
 036            if (Frame < other.Frame)
 037            {
 038                return -1;
 39            }
 40
 041            return 0;
 042        }
 43
 44        public int Compare(ConsoleLogEntry x, ConsoleLogEntry y)
 045        {
 046            if (x.Frame > y.Frame)
 047            {
 048                return 1;
 49            }
 50
 051            if (x.Frame < y.Frame)
 052            {
 053                return -1;
 54            }
 55
 056            return 0;
 057        }
 58    }
 59}

Coverage by test methods



Methods/Properties

ConsoleLogEntry(UnityEngine.LogType, System.String, System.String)
CompareTo(GDX.Developer.ConsoleLogEntry)
Compare(GDX.Developer.ConsoleLogEntry, GDX.Developer.ConsoleLogEntry)