| | 1 | | using System.Collections; |
| | 2 | | using System.Collections.Generic; |
| | 3 | | using Builder.Gizmos; |
| | 4 | | using DCL.Configuration; |
| | 5 | | using DCL.Helpers; |
| | 6 | | using NUnit.Framework; |
| | 7 | | using UnityEngine; |
| | 8 | |
|
| | 9 | | public class BIWGizmosShould : IntegrationTestSuite_Legacy |
| | 10 | | { |
| | 11 | | private DCLBuilderGizmoManager gizmosController; |
| | 12 | |
|
| | 13 | | protected override IEnumerator SetUp() |
| | 14 | | { |
| 7 | 15 | | yield return base.SetUp(); |
| 7 | 16 | | BuilderInWorldController controller = Resources.FindObjectsOfTypeAll<BuilderInWorldController>()[0]; |
| 7 | 17 | | gizmosController = controller.biwModeController.editorMode.gizmoManager; |
| 7 | 18 | | } |
| | 19 | |
|
| | 20 | | [Test] |
| | 21 | | public void TestDesactivateGizmos() |
| | 22 | | { |
| | 23 | | //Act |
| 1 | 24 | | gizmosController.HideGizmo(true); |
| | 25 | |
|
| | 26 | | //Assert |
| 1 | 27 | | Assert.AreEqual(gizmosController.GetSelectedGizmo(), DCL.Components.DCLGizmos.Gizmo.NONE); |
| 1 | 28 | | } |
| | 29 | |
|
| | 30 | | [Test] |
| | 31 | | public void TestActivationTranslateGizmos() |
| | 32 | | { |
| | 33 | | //Act |
| 1 | 34 | | gizmosController.SetGizmoType(BuilderInWorldSettings.TRANSLATE_GIZMO_NAME); |
| | 35 | |
|
| | 36 | | //Assert |
| 1 | 37 | | Assert.AreEqual(gizmosController.GetSelectedGizmo(), BuilderInWorldSettings.TRANSLATE_GIZMO_NAME); |
| 1 | 38 | | } |
| | 39 | |
|
| | 40 | | [Test] |
| | 41 | | public void TestActivationRotateGizmos() |
| | 42 | | { |
| | 43 | | //Act |
| 1 | 44 | | gizmosController.SetGizmoType(BuilderInWorldSettings.ROTATE_GIZMO_NAME); |
| | 45 | |
|
| | 46 | | //Assert |
| 1 | 47 | | Assert.AreEqual(gizmosController.GetSelectedGizmo(), BuilderInWorldSettings.ROTATE_GIZMO_NAME); |
| 1 | 48 | | } |
| | 49 | |
|
| | 50 | | [Test] |
| | 51 | | public void TestActivationScaleGizmos() |
| | 52 | | { |
| | 53 | | //Act |
| 1 | 54 | | gizmosController.SetGizmoType(BuilderInWorldSettings.SCALE_GIZMO_NAME); |
| | 55 | |
|
| | 56 | | //Assert |
| 1 | 57 | | Assert.AreEqual(gizmosController.GetSelectedGizmo(), BuilderInWorldSettings.SCALE_GIZMO_NAME); |
| 1 | 58 | | } |
| | 59 | |
|
| | 60 | | [Test] |
| | 61 | | public void TestTranslateGizmosType() |
| | 62 | | { |
| | 63 | | //Arrange |
| 1 | 64 | | gizmosController.SetGizmoType(BuilderInWorldSettings.TRANSLATE_GIZMO_NAME); |
| 1 | 65 | | DCLBuilderGizmo translateGizmo = gizmosController.activeGizmo; |
| | 66 | |
|
| | 67 | | //Assert |
| 1 | 68 | | Assert.IsInstanceOf(typeof(DCLBuilderTranslateGizmo), translateGizmo); |
| 1 | 69 | | } |
| | 70 | |
|
| | 71 | | [Test] |
| | 72 | | public void TestRotateGizmosType() |
| | 73 | | { |
| | 74 | | //Arrange |
| 1 | 75 | | gizmosController.SetGizmoType(BuilderInWorldSettings.ROTATE_GIZMO_NAME); |
| 1 | 76 | | DCLBuilderGizmo gizmo = gizmosController.activeGizmo; |
| | 77 | |
|
| | 78 | | //Assert |
| 1 | 79 | | Assert.IsInstanceOf(typeof(DCLBuilderRotateGizmo), gizmo); |
| 1 | 80 | | } |
| | 81 | |
|
| | 82 | | [Test] |
| | 83 | | public void TestScaleGizmosType() |
| | 84 | | { |
| | 85 | | //Arrange |
| 1 | 86 | | gizmosController.SetGizmoType(BuilderInWorldSettings.SCALE_GIZMO_NAME); |
| 1 | 87 | | DCLBuilderGizmo gizmo = gizmosController.activeGizmo; |
| | 88 | |
|
| | 89 | | //Assert |
| 1 | 90 | | Assert.IsInstanceOf(typeof(DCLBuilderScaleGizmo), gizmo); |
| 1 | 91 | | } |
| | 92 | | } |