< Summary

Class:GDX.Developer.Reports.Resource.ResourceReportContext
Assembly:GDX
File(s):./Packages/com.dotbunny.gdx/GDX/Developer/Reports/Resource/ResourceReportContext.cs
Covered lines:11
Uncovered lines:0
Coverable lines:11
Total lines:40
Line coverage:100% (11 of 11)
Covered branches:0
Total branches:0
Covered methods:1
Total methods:1
Method coverage:100% (1 of 1)

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ResourceReportContext(...)0%110100%

File(s)

./Packages/com.dotbunny.gdx/GDX/Developer/Reports/Resource/ResourceReportContext.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
 5#if !UNITY_DOTSRUNTIME
 6
 7namespace GDX.Developer.Reports.Resource
 8{
 9    /// <summary>
 10    ///     Context for generating a <see cref="ResourceReport" /> based report.
 11    /// </summary>
 12    /// <exception cref="UnsupportedRuntimeException">Not supported on DOTS Runtime.</exception>
 13    public sealed class ResourceReportContext
 14    {
 15        public readonly int CharacterWidth;
 16        public readonly int KeyValuePairInfoWidth;
 17        public readonly int KeyValuePairWidth;
 18        public readonly int ObjectInfoWidth;
 19        public readonly int ObjectNameWidth;
 20        public readonly int ObjectSizeWidth;
 21
 22        public readonly int ObjectTypeWidth;
 23
 724        public ResourceReportContext(int characterWidth = 120)
 725        {
 726            CharacterWidth = characterWidth;
 727            KeyValuePairWidth = characterWidth / 3;
 728            KeyValuePairInfoWidth = (CharacterWidth - KeyValuePairWidth) / 2;
 29
 730            float percent = characterWidth / 100f;
 31
 732            ObjectTypeWidth = (int)percent * 15;
 733            ObjectNameWidth = (int)(percent * 33.333f);
 734            ObjectSizeWidth = (int)percent * 11;
 35
 736            ObjectInfoWidth = characterWidth - (ObjectTypeWidth + ObjectNameWidth + ObjectSizeWidth + 3);
 737        }
 38    }
 39}
 40#endif // !UNITY_DOTSRUNTIME

Coverage by test methods







Methods/Properties

ResourceReportContext(System.Int32)