| | 1 | | using DCL.Components; |
| | 2 | | using DCL.Helpers; |
| | 3 | | using DCL.Models; |
| | 4 | | using NUnit.Framework; |
| | 5 | | using System.Collections; |
| | 6 | | using UnityEngine; |
| | 7 | | using UnityEngine.TestTools; |
| | 8 | |
|
| | 9 | | public class UIContainerRectVisualTests : UIVisualTestsBase |
| | 10 | | { |
| | 11 | | [UnityTest] |
| | 12 | | [Explicit] |
| | 13 | | [VisualTest] |
| | 14 | | [Category("Explicit")] |
| 0 | 15 | | public IEnumerator UIContainerRectVisualTests_Generate() { yield return VisualTestHelpers.GenerateBaselineForTest(UI |
| | 16 | |
|
| | 17 | | [UnityTest] |
| | 18 | | [VisualTest] |
| | 19 | | [Category("Visual Tests")] |
| | 20 | | public IEnumerator UIContainerRectTest1() |
| | 21 | | { |
| 1 | 22 | | yield return InitUIVisualTestScene("UIContainerRectTest"); |
| | 23 | |
|
| 1 | 24 | | string mainContainerId = "herodes"; |
| 1 | 25 | | 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 | |
|
| 1 | 33 | | 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 | |
|
| 1 | 43 | | 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 | |
|
| 1 | 52 | | 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 | |
|
| 1 | 62 | | 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 | |
|
| 1 | 71 | | 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 | |
|
| 1 | 80 | | 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 | |
|
| 1 | 88 | | 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 | |
|
| 1 | 97 | | 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 | |
|
| 1 | 107 | | 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 | |
|
| 1 | 116 | | 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 | |
|
| 1 | 126 | | 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 | |
|
| 1 | 138 | | yield return VisualTestHelpers.TakeSnapshot(new Vector3(0f, 2f, 0f)); |
| 1 | 139 | | } |
| | 140 | | } |