| | 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 UITextVisualTests : UIVisualTestsBase |
| | 10 | | { |
| | 11 | | [UnityTest] |
| | 12 | | [Explicit] |
| | 13 | | [Category("Explicit")] |
| 0 | 14 | | public IEnumerator UITextVisualTests_Generate() { yield return VisualTestHelpers.GenerateBaselineForTest(UITextTest1 |
| | 15 | |
|
| | 16 | | [UnityTest] |
| | 17 | | [VisualTest] |
| | 18 | | [Category("Visual Tests")] |
| | 19 | | public IEnumerator UITextTest1() |
| | 20 | | { |
| 1 | 21 | | yield return InitUIVisualTestScene("UITextTest"); |
| | 22 | |
|
| 1 | 23 | | var uiInputText = TestHelpers.SharedComponentCreate<UIText, UIText.Model>(scene, CLASS_ID.UI_TEXT_SHAPE); |
| 1 | 24 | | yield return uiInputText.routine; |
| | 25 | |
|
| 1 | 26 | | 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 | |
|
| 1 | 65 | | yield return VisualTestHelpers.TakeSnapshot(new Vector3(0f, 2f, 0f)); |
| 1 | 66 | | } |
| | 67 | | } |