< Summary

Class:DCL.InputTextTestsController
Assembly:UIInputTextTests
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Components/UI/UIInputText/Tests/InputTextTestsController.cs
Covered lines:0
Uncovered lines:15
Coverable lines:15
Total lines:71
Line coverage:0% (0 of 15)
Covered branches:0
Total branches:0

Metrics

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

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Components/UI/UIInputText/Tests/InputTextTestsController.cs

#LineLine coverage
 1using DCL.Components;
 2using DCL.Controllers;
 3using DCL.Helpers;
 4using System.Collections;
 5using UnityEngine;
 6
 7namespace DCL
 8{
 9    public class InputTextTestsController : MonoBehaviour
 10    {
 11        protected ISceneController sceneController;
 12        protected ParcelScene scene;
 13
 14        protected IEnumerator InitScene(bool spawnCharController = true)
 15        {
 016            sceneController = Environment.i.world.sceneController;
 17
 018            yield return new WaitForSeconds(0.01f);
 19
 020            scene = sceneController.CreateTestScene() as ParcelScene;
 21
 022            yield return new WaitForSeconds(0.01f);
 23
 024            if (spawnCharController)
 25            {
 026                if (DCLCharacterController.i == null)
 27                {
 028                    GameObject.Instantiate(Resources.Load("Prefabs/CharacterController"));
 29                }
 30            }
 031        }
 32
 33        public IEnumerator Start()
 34        {
 035            yield return InitScene(spawnCharController: false);
 36
 037            DCLCharacterController.i.gravity = 0;
 38
 039            UIScreenSpace ssshape = TestHelpers.SharedComponentCreate<UIScreenSpace, UIScreenSpace.Model>(
 40                scene,
 41                DCL.Models.CLASS_ID.UI_SCREEN_SPACE_SHAPE);
 42
 043            yield return ssshape.routine;
 44
 045            UIInputText text = TestHelpers.SharedComponentCreate<UIInputText, UIInputText.Model>(
 46                scene,
 47                Models.CLASS_ID.UI_INPUT_TEXT_SHAPE,
 48                new UIInputText.Model()
 49                {
 50                    textModel = new DCL.Components.TextShape.Model()
 51                    {
 52                        color = Color.white,
 53                        opacity = 1,
 54                    },
 55
 56                    placeholder = "Chat here!",
 57                    placeholderColor = Color.grey,
 58                    focusedBackground = Color.black,
 59                    parentComponent = ssshape.id,
 60                    positionX = new UIValue(200, UIValue.Unit.PIXELS),
 61                    positionY = new UIValue(200, UIValue.Unit.PIXELS),
 62                    height = new UIValue(200, UIValue.Unit.PIXELS),
 63                    width = new UIValue(200, UIValue.Unit.PIXELS),
 64                    hAlign = "left",
 65                    vAlign = "top",
 66                });
 67
 068            yield return text.routine;
 069        }
 70    }
 71}

Methods/Properties

InitScene()
Start()