| | 1 | | using System.Collections; |
| | 2 | | using NUnit.Framework; |
| | 3 | | using UnityEngine.TestTools; |
| | 4 | |
|
| | 5 | | namespace Tests |
| | 6 | | { |
| | 7 | | public class ControlsHUDTest : IntegrationTestSuite_Legacy |
| | 8 | | { |
| | 9 | | private ControlsHUDController controller; |
| | 10 | |
|
| | 11 | | protected override IEnumerator SetUp() |
| | 12 | | { |
| 2 | 13 | | yield return base.SetUp(); |
| 2 | 14 | | controller = new ControlsHUDController(); |
| 2 | 15 | | } |
| | 16 | |
|
| | 17 | | protected override IEnumerator TearDown() |
| | 18 | | { |
| 2 | 19 | | controller.Dispose(); |
| 2 | 20 | | yield return base.TearDown(); |
| 2 | 21 | | } |
| | 22 | |
|
| | 23 | | [UnityTest] |
| | 24 | | public IEnumerator CreateView() |
| | 25 | | { |
| 1 | 26 | | Assert.NotNull(controller.view); |
| 1 | 27 | | Assert.NotNull(controller.view.gameObject); |
| 1 | 28 | | yield break; |
| | 29 | | } |
| | 30 | |
|
| | 31 | | [UnityTest] |
| | 32 | | public IEnumerator OpenAndCloseCorrectly() |
| | 33 | | { |
| 1 | 34 | | controller.SetVisibility(true); |
| 1 | 35 | | Assert.IsTrue(controller.view.gameObject.activeSelf, "controls hud should be visible"); |
| 1 | 36 | | controller.view.showHideAnimator.Hide(true); |
| 1 | 37 | | Assert.IsFalse(controller.view.gameObject.activeSelf, "controls hud should not be visible"); |
| 1 | 38 | | yield break; |
| | 39 | | } |
| | 40 | | } |
| | 41 | | } |