| | 1 | | using NUnit.Framework; |
| | 2 | | using UnityEngine; |
| | 3 | |
|
| | 4 | | namespace Tests.BuildModeHUDViews |
| | 5 | | { |
| | 6 | | public class DragAndDropSceneObjectViewShould |
| | 7 | | { |
| | 8 | | private DragAndDropSceneObjectView dragAndDropSceneObjectView; |
| | 9 | |
|
| | 10 | | [SetUp] |
| 2 | 11 | | public void SetUp() { dragAndDropSceneObjectView = DragAndDropSceneObjectView.Create(); } |
| | 12 | |
|
| | 13 | | [TearDown] |
| 2 | 14 | | public void TearDown() { Object.Destroy(dragAndDropSceneObjectView.gameObject); } |
| | 15 | |
|
| | 16 | | [Test] |
| | 17 | | public void DropCorrectly() |
| | 18 | | { |
| | 19 | | // Arrange |
| 1 | 20 | | bool isDropped = false; |
| 2 | 21 | | dragAndDropSceneObjectView.OnDrop += () => isDropped = true; |
| | 22 | |
|
| | 23 | | // Act |
| 1 | 24 | | dragAndDropSceneObjectView.Drop(); |
| | 25 | |
|
| | 26 | | // Assert |
| 1 | 27 | | Assert.IsTrue(isDropped, "isDropped is false!"); |
| 1 | 28 | | } |
| | 29 | | } |
| | 30 | | } |