< Summary

Class:InteractiveObjectsHoverTestSceneController
Assembly:TestHelpers
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/Tests/InteractiveObjectsHoverTestSceneController.cs
Covered lines:0
Uncovered lines:18
Coverable lines:18
Total lines:59
Line coverage:0% (0 of 18)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Start()0%20400%
InitScene()0%20400%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/Tests/InteractiveObjectsHoverTestSceneController.cs

#LineLine coverage
 1using DCL;
 2using DCL.Components;
 3using DCL.Controllers;
 4using DCL.Helpers;
 5using DCL.Interface;
 6using DCL.Models;
 7using Newtonsoft.Json;
 8using System.Collections;
 9using UnityEngine;
 10
 11public class InteractiveObjectsHoverTestSceneController : MonoBehaviour
 12{
 13    public WebInterface.ACTION_BUTTON button = WebInterface.ACTION_BUTTON.POINTER;
 14
 15    ParcelScene scene;
 16
 17    IEnumerator Start()
 18    {
 019        yield return InitScene();
 20
 021        string entityId = "1";
 22
 023        var entity = TestHelpers.CreateSceneEntity(scene, entityId);
 24
 025        string shapeId = TestHelpers.CreateAndSetShape(scene, entityId, DCL.Models.CLASS_ID.GLTF_SHAPE,
 26            JsonConvert.SerializeObject(new
 27            {
 28                src = TestAssetsUtils.GetPath() + "/GLB/Lantern/Lantern.glb"
 29            }));
 30
 031        LoadWrapper_GLTF gltfShape = GLTFShape.GetLoaderForEntity(entity) as LoadWrapper_GLTF;
 032        yield return new DCL.WaitUntil(() => gltfShape.alreadyLoaded, 7f);
 33
 034        TestHelpers.SetEntityTransform(scene, entity, new Vector3(8, -1, 8), Quaternion.identity, new Vector3(0.5f, 0.5f
 35
 036        var onClickComponentModel = new OnClick.Model()
 37        {
 38            type = OnClick.NAME,
 39            uuid = "pointerevent-1",
 40            button = this.button.ToString()
 41        };
 042        var onClickComponent = TestHelpers.EntityComponentCreate<OnClick, OnClick.Model>(scene, entity, onClickComponent
 43
 044        scene.sceneLifecycleHandler.SetInitMessagesDone();
 45
 046        OnPointerEvent.enableInteractionHoverFeedback = true;
 047    }
 48
 49    protected virtual IEnumerator InitScene()
 50    {
 051        DCL.Configuration.EnvironmentSettings.DEBUG = true;
 052        Environment.i.platform.debugController.SetDebug();
 53
 054        yield return new WaitForSeconds(0.01f);
 55
 056        scene = Environment.i.world.sceneController.CreateTestScene() as ParcelScene;
 057        yield return null;
 058    }
 59}

Methods/Properties

Start()
InitScene()