< Summary

Class:SceneBoundariesCheckerTests.SceneBoundariesCheckerTests_DebugMode
Assembly:SceneBoundariesCheckerTests
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/WorldRuntime/SceneBoundariesController/Tests/SceneBoundariesCheckerTests_DebugMode.cs
Covered lines:38
Uncovered lines:4
Coverable lines:42
Total lines:120
Line coverage:90.4% (38 of 42)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
SetUp()0%440100%
ResetMaterialCorrectlyWhenInvalidEntitiesAreRemoved()0%880100%
PShapeIsInvalidatedWhenStartingOutOfBoundsDebugMode()0%330100%
GLTFShapeIsInvalidatedWhenStartingOutOfBoundsDebugMode()0%330100%
NFTShapeIsInvalidatedWhenStartingOutOfBoundsDebugMode()0%12300%
PShapeIsInvalidatedWhenLeavingBoundsDebugMode()0%330100%
GLTFShapeIsInvalidatedWhenLeavingBoundsDebugMode()0%330100%
NFTShapeIsInvalidatedWhenLeavingBoundsDebugMode()0%12300%
PShapeIsResetWhenReenteringBoundsDebugMode()0%330100%
NFTShapeIsResetWhenReenteringBoundsDebugMode()0%12300%
ChildShapeIsEvaluatedDebugMode()0%330100%
ChildShapeIsEvaluatedOnShapelessParentDebugMode()0%330100%
HeightIsEvaluatedDebugMode()0%330100%
GLTFShapeIsResetWhenReenteringBoundsDebugMode()0%330100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/WorldRuntime/SceneBoundariesController/Tests/SceneBoundariesCheckerTests_DebugMode.cs

#LineLine coverage
 1using NUnit.Framework;
 2using System.Collections;
 3using DCL;
 4using DCL.Components;
 5using DCL.Controllers;
 6using DCL.Helpers;
 7using Newtonsoft.Json;
 8using UnityEngine;
 9using UnityEngine.TestTools;
 10
 11namespace SceneBoundariesCheckerTests
 12{
 13    public class SceneBoundariesCheckerTests_DebugMode : IntegrationTestSuite_Legacy
 14    {
 015        protected override bool enableSceneIntegrityChecker => false;
 1016        protected override bool justSceneSetUp => true;
 17
 18        protected override IEnumerator SetUp()
 19        {
 1020            yield return base.SetUp();
 21
 1022            yield return SetUp_CharacterController();
 23
 1024            Environment.i.world.sceneBoundsChecker.SetFeedbackStyle(new SceneBoundsFeedbackStyle_RedFlicker());
 1025            Environment.i.world.sceneBoundsChecker.timeBetweenChecks = 0f;
 26
 1027            UnityEngine.Assertions.Assert.IsTrue(Environment.i.world.sceneBoundsChecker.enabled);
 1028            UnityEngine.Assertions.Assert.IsTrue(Environment.i.world.sceneBoundsChecker.GetFeedbackStyle() is SceneBound
 1029        }
 30
 31        [UnityTest]
 32        public IEnumerator ResetMaterialCorrectlyWhenInvalidEntitiesAreRemoved()
 33        {
 134            var entity = TestHelpers.CreateSceneEntity(scene);
 135            TestHelpers.SetEntityTransform(scene, entity, new DCLTransform.Model { position = new Vector3(8, 1, 8) });
 136            TestHelpers.CreateAndSetShape(scene, entity.entityId, DCL.Models.CLASS_ID.GLTF_SHAPE, JsonConvert.SerializeO
 37                new
 38                {
 39                    src = TestAssetsUtils.GetPath() + "/GLB/PalmTree_01.glb"
 40                }));
 41
 142            LoadWrapper gltfShape = GLTFShape.GetLoaderForEntity(entity);
 743            yield return new UnityEngine.WaitUntil(() => gltfShape.alreadyLoaded);
 44
 145            yield return null;
 46
 147            SBC_Asserts.AssertMeshIsValid(entity.meshesInfo);
 48            // Move object to surpass the scene boundaries
 149            TestHelpers.SetEntityTransform(scene, entity, new DCLTransform.Model { position = new Vector3(18, 1, 18) });
 50
 151            yield return null;
 52
 153            SBC_Asserts.AssertMeshIsInvalid(entity.meshesInfo);
 54
 155            TestHelpers.RemoveSceneEntity(scene, entity.entityId);
 56
 157            Environment.i.platform.parcelScenesCleaner.ForceCleanup();
 58
 159            yield return null;
 60
 161            var entity2 = TestHelpers.CreateSceneEntity(scene);
 62
 163            TestHelpers.SetEntityTransform(scene, entity2, new DCLTransform.Model { position = new Vector3(8, 1, 8) });
 164            TestHelpers.CreateAndSetShape(scene, entity2.entityId, DCL.Models.CLASS_ID.GLTF_SHAPE, JsonConvert.Serialize
 65                new
 66                {
 67                    src = TestAssetsUtils.GetPath() + "/GLB/PalmTree_01.glb"
 68                }));
 69
 170            LoadWrapper gltfShape2 = GLTFShape.GetLoaderForEntity(entity2);
 71
 272            yield return new UnityEngine.WaitUntil(() => gltfShape2.alreadyLoaded);
 173            yield return null;
 74
 175            SBC_Asserts.AssertMeshIsValid(entity2.meshesInfo);
 176        }
 77
 78        [UnityTest]
 279        public IEnumerator PShapeIsInvalidatedWhenStartingOutOfBoundsDebugMode() { yield return SBC_Asserts.PShapeIsInva
 80
 81        [UnityTest]
 282        public IEnumerator GLTFShapeIsInvalidatedWhenStartingOutOfBoundsDebugMode() { yield return SBC_Asserts.GLTFShape
 83
 84        [UnityTest]
 85        [Explicit("Test taking too long")]
 86        [Category("Explicit")]
 087        public IEnumerator NFTShapeIsInvalidatedWhenStartingOutOfBoundsDebugMode() { yield return SBC_Asserts.NFTShapeIs
 88
 89        [UnityTest]
 290        public IEnumerator PShapeIsInvalidatedWhenLeavingBoundsDebugMode() { yield return SBC_Asserts.PShapeIsInvalidate
 91
 92        [UnityTest]
 293        public IEnumerator GLTFShapeIsInvalidatedWhenLeavingBoundsDebugMode() { yield return SBC_Asserts.GLTFShapeIsInva
 94
 95        [UnityTest]
 96        [Explicit("Test taking too long")]
 97        [Category("Explicit")]
 098        public IEnumerator NFTShapeIsInvalidatedWhenLeavingBoundsDebugMode() { yield return SBC_Asserts.NFTShapeIsInvali
 99
 100        [UnityTest]
 2101        public IEnumerator PShapeIsResetWhenReenteringBoundsDebugMode() { yield return SBC_Asserts.PShapeIsResetWhenReen
 102
 103        [UnityTest]
 104        [Explicit("Test taking too long")]
 105        [Category("Explicit")]
 0106        public IEnumerator NFTShapeIsResetWhenReenteringBoundsDebugMode() { yield return SBC_Asserts.NFTShapeIsResetWhen
 107
 108        [UnityTest]
 2109        public IEnumerator ChildShapeIsEvaluatedDebugMode() { yield return SBC_Asserts.ChildShapeIsEvaluated(scene); }
 110
 111        [UnityTest]
 2112        public IEnumerator ChildShapeIsEvaluatedOnShapelessParentDebugMode() { yield return SBC_Asserts.ChildShapeIsEval
 113
 114        [UnityTest]
 2115        public IEnumerator HeightIsEvaluatedDebugMode() { yield return SBC_Asserts.HeightIsEvaluated(scene); }
 116
 117        [UnityTest]
 2118        public IEnumerator GLTFShapeIsResetWhenReenteringBoundsDebugMode() { yield return SBC_Asserts.GLTFShapeIsResetWh
 119    }
 120}