< Summary

Class:UIContainerRectVisualTests
Assembly:UIContainerRectTests
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Components/UI/UIContainer/Tests/UIContainerRectVisualTests.cs
Covered lines:16
Uncovered lines:1
Coverable lines:17
Total lines:140
Line coverage:94.1% (16 of 17)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
UIContainerRectVisualTests_Generate()0%12300%
UIContainerRectTest1()0%16160100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Components/UI/UIContainer/Tests/UIContainerRectVisualTests.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 UIContainerRectVisualTests : UIVisualTestsBase
 10{
 11    [UnityTest]
 12    [Explicit]
 13    [VisualTest]
 14    [Category("Explicit")]
 015    public IEnumerator UIContainerRectVisualTests_Generate() { yield return VisualTestHelpers.GenerateBaselineForTest(UI
 16
 17    [UnityTest]
 18    [VisualTest]
 19    [Category("Visual Tests")]
 20    public IEnumerator UIContainerRectTest1()
 21    {
 122        yield return InitUIVisualTestScene("UIContainerRectTest");
 23
 124        string mainContainerId = "herodes";
 125        yield return CreateUIComponent<UIContainerRect, UIContainerRect.Model>(CLASS_ID.UI_CONTAINER_RECT, new UIContain
 26        {
 27            parentComponent = screenSpaceId,
 28            color = Color.green,
 29            width = new UIValue(50f, UIValue.Unit.PERCENT),
 30            height = new UIValue(50f, UIValue.Unit.PERCENT)
 31        }, mainContainerId);
 32
 133        yield return CreateUIComponent<UIContainerRect, UIContainerRect.Model>(CLASS_ID.UI_CONTAINER_RECT, new UIContain
 34        {
 35            parentComponent = mainContainerId,
 36            color = Color.red,
 37            width = new UIValue(25f, UIValue.Unit.PERCENT),
 38            height = new UIValue(100f),
 39            hAlign = "left",
 40            vAlign = "top"
 41        }, "innerPanelTopLeft");
 42
 143        yield return CreateUIComponent<UIContainerRect, UIContainerRect.Model>(CLASS_ID.UI_CONTAINER_RECT, new UIContain
 44        {
 45            parentComponent = mainContainerId,
 46            color = Color.red,
 47            width = new UIValue(25f, UIValue.Unit.PERCENT),
 48            height = new UIValue(100f),
 49            hAlign = "left"
 50        }, "innerPanelCenterLeft");
 51
 152        yield return CreateUIComponent<UIContainerRect, UIContainerRect.Model>(CLASS_ID.UI_CONTAINER_RECT, new UIContain
 53        {
 54            parentComponent = mainContainerId,
 55            color = Color.red,
 56            width = new UIValue(25f, UIValue.Unit.PERCENT),
 57            height = new UIValue(25f, UIValue.Unit.PERCENT),
 58            hAlign = "left",
 59            vAlign = "bottom"
 60        }, "innerPanelBottomLeft");
 61
 162        yield return CreateUIComponent<UIContainerRect, UIContainerRect.Model>(CLASS_ID.UI_CONTAINER_RECT, new UIContain
 63        {
 64            parentComponent = mainContainerId,
 65            color = Color.red,
 66            width = new UIValue(25f, UIValue.Unit.PERCENT),
 67            height = new UIValue(25f, UIValue.Unit.PERCENT),
 68            vAlign = "top"
 69        }, "innerPanelTopCenter");
 70
 171        yield return CreateUIComponent<UIContainerRect, UIContainerRect.Model>(CLASS_ID.UI_CONTAINER_RECT, new UIContain
 72        {
 73            parentComponent = mainContainerId,
 74            color = Color.red,
 75            width = new UIValue(25f, UIValue.Unit.PERCENT),
 76            height = new UIValue(25f, UIValue.Unit.PERCENT),
 77            vAlign = "top"
 78        }, "innerPanelTopCenter");
 79
 180        yield return CreateUIComponent<UIContainerRect, UIContainerRect.Model>(CLASS_ID.UI_CONTAINER_RECT, new UIContain
 81        {
 82            parentComponent = mainContainerId,
 83            color = Color.red,
 84            width = new UIValue(25f),
 85            height = new UIValue(25f)
 86        }, "innerPanelCenterCenter");
 87
 188        yield return CreateUIComponent<UIContainerRect, UIContainerRect.Model>(CLASS_ID.UI_CONTAINER_RECT, new UIContain
 89        {
 90            parentComponent = mainContainerId,
 91            color = Color.red,
 92            width = new UIValue(25f, UIValue.Unit.PERCENT),
 93            height = new UIValue(25f, UIValue.Unit.PERCENT),
 94            vAlign = "bottom"
 95        }, "innerPanelBottomCenter");
 96
 197        yield return CreateUIComponent<UIContainerRect, UIContainerRect.Model>(CLASS_ID.UI_CONTAINER_RECT, new UIContain
 98        {
 99            parentComponent = mainContainerId,
 100            color = Color.red,
 101            width = new UIValue(100f),
 102            height = new UIValue(25f, UIValue.Unit.PERCENT),
 103            hAlign = "right",
 104            vAlign = "top"
 105        }, "innerPanelTopRight");
 106
 1107        yield return CreateUIComponent<UIContainerRect, UIContainerRect.Model>(CLASS_ID.UI_CONTAINER_RECT, new UIContain
 108        {
 109            parentComponent = mainContainerId,
 110            color = Color.red,
 111            width = new UIValue(25f, UIValue.Unit.PERCENT),
 112            height = new UIValue(25f, UIValue.Unit.PERCENT),
 113            hAlign = "right"
 114        }, "innerPanelCenterRight");
 115
 1116        yield return CreateUIComponent<UIContainerRect, UIContainerRect.Model>(CLASS_ID.UI_CONTAINER_RECT, new UIContain
 117        {
 118            parentComponent = mainContainerId,
 119            color = Color.red,
 120            width = new UIValue(25f, UIValue.Unit.PERCENT),
 121            height = new UIValue(25f, UIValue.Unit.PERCENT),
 122            hAlign = "right",
 123            vAlign = "bottom"
 124        }, "innerPanelBottomRight");
 125
 1126        yield return CreateUIComponent<UIContainerRect, UIContainerRect.Model>(CLASS_ID.UI_CONTAINER_RECT, new UIContain
 127        {
 128            parentComponent = mainContainerId,
 129            color = Color.blue,
 130            width = new UIValue(50f, UIValue.Unit.PERCENT),
 131            height = new UIValue(50f, UIValue.Unit.PERCENT),
 132            hAlign = "right",
 133            vAlign = "bottom",
 134            positionX = new UIValue(-20f, UIValue.Unit.PERCENT),
 135            positionY = new UIValue(20f, UIValue.Unit.PERCENT)
 136        }, "innerPanel1");
 137
 1138        yield return VisualTestHelpers.TakeSnapshot(new Vector3(0f, 2f, 0f));
 1139    }
 140}