Last active
February 19, 2022 20:57
-
-
Save aallbrig/b21d800f3cc63d96055db8044978280c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PrefabIntegrationTests | |
{ | |
public string PrefabLocation => "Prefabs/Player"; | |
[UnityTest] | |
public IEnumerator PlayerPrefab_RespondsToDownwardSwipe() | |
{ | |
var testLocation = TestLocation.Next(); | |
Object.Instantiate(Resources.Load<GameObject>(TestPlatform), testLocation); | |
var sut = Object.Instantiate(Resources.Load<GameObject>(PrefabLocation), testLocation); | |
InputSystem.AddDevice<Touchscreen>(); | |
var pointer = InputSystem.AddDevice<Pointer>(); | |
yield return null; | |
var positionA = sut.transform.position; | |
BeginTouch(pointer.deviceId, Vector2.up * 2); | |
EndTouch(pointer.deviceId, Vector2.zero); | |
yield return null; | |
yield return new WaitForSeconds(0.25f); | |
var positionB = sut.transform.position; | |
Assert.IsTrue(Vector3.Distance(positionA, positionB) > 0); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment