< Summary

Class:UITextVisualTests
Assembly:UITextTests
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Components/UI/UIText/Tests/UITextVisualTests.cs
Covered lines:6
Uncovered lines:1
Coverable lines:7
Total lines:67
Line coverage:85.7% (6 of 7)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
UITextVisualTests_Generate()0%12300%
UITextTest1()0%660100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Components/UI/UIText/Tests/UITextVisualTests.cs

#LineLine coverage
 1using DCL.Components;
 2using DCL.Helpers;
 3using DCL.Models;
 4using NUnit.Framework;
 5using System.Collections;
 6using UnityEngine;
 7using UnityEngine.TestTools;
 8
 9public class UITextVisualTests : UIVisualTestsBase
 10{
 11    [UnityTest]
 12    [Explicit]
 13    [Category("Explicit")]
 014    public IEnumerator UITextVisualTests_Generate() { yield return VisualTestHelpers.GenerateBaselineForTest(UITextTest1
 15
 16    [UnityTest]
 17    [VisualTest]
 18    [Category("Visual Tests")]
 19    public IEnumerator UITextTest1()
 20    {
 121        yield return InitUIVisualTestScene("UITextTest");
 22
 123        var uiInputText = TestHelpers.SharedComponentCreate<UIText, UIText.Model>(scene, CLASS_ID.UI_TEXT_SHAPE);
 124        yield return uiInputText.routine;
 25
 126        yield return TestHelpers.SharedComponentUpdate(uiInputText, new UIText.Model
 27        {
 28            parentComponent = screenSpaceId,
 29            name = "testUIText",
 30            isPointerBlocker = true,
 31            hAlign = "center",
 32            vAlign = "center",
 33            positionX = new UIValue(0f),
 34            positionY = new UIValue(0f),
 35            visible = true,
 36            textModel = new TextShape.Model
 37            {
 38                paddingLeft = 10,
 39                paddingRight = 10,
 40                paddingTop = 10,
 41                paddingBottom = 10,
 42                outlineWidth = 0.1f,
 43                outlineColor = Color.green,
 44                color = Color.red,
 45                fontSize = 100,
 46                fontWeight = "normal",
 47                opacity = 1,
 48                value = "Hello World!",
 49                lineSpacing = 0,
 50                lineCount = 0,
 51                adaptWidth = true,
 52                adaptHeight = true,
 53                textWrapping = false,
 54                shadowBlur = 0,
 55                shadowOffsetX = 0,
 56                shadowOffsetY = 0,
 57                shadowColor = Color.black,
 58                hTextAlign = "center",
 59                vTextAlign = "center",
 60                width = 300,
 61                height = 200,
 62            }
 63        });
 64
 165        yield return VisualTestHelpers.TakeSnapshot(new Vector3(0f, 2f, 0f));
 166    }
 67}