public void ShouldRaiseFloatGameEvent() { var tester = new GameEventTester < FloatGameEventListener, FloatGameEvent, FloatEvent, float >(); tester.SetActive(true); tester.RaiseGameEvent(10f); Assert.AreEqual(10f, tester.GetLastEventValue()); Assert.AreEqual(1, tester.GetEventCount()); tester.Clear(); tester.SetActive(false); tester.RaiseGameEvent(10f); Assert.AreEqual(0, tester.GetEventCount()); }
public void ShouldRaiseVector3EventListener() { var tester = new GameEventTester < Vector3GameEventListener, Vector3GameEvent, Vector3Event, UnityEngine.Vector3 >(); tester.SetActive(true); tester.RaiseGameEvent(UnityEngine.Vector3.one); Assert.AreEqual(UnityEngine.Vector3.one, tester.GetLastEventValue()); Assert.AreEqual(1, tester.GetEventCount()); tester.Clear(); tester.SetActive(false); tester.RaiseGameEvent(UnityEngine.Vector3.one); Assert.AreEqual(0, tester.GetEventCount()); }
public void ShouldRaiseStringGameEventListener() { var tester = new GameEventTester < StringGameEventListener, StringGameEvent, StringEvent, string >(); tester.SetActive(true); tester.RaiseGameEvent("foo"); Assert.AreEqual("foo", tester.GetLastEventValue()); Assert.AreEqual(1, tester.GetEventCount()); tester.Clear(); tester.SetActive(false); tester.RaiseGameEvent("foo"); Assert.AreEqual(0, tester.GetEventCount()); }
public void ShouldRaiseBoolGameEvent() { var tester = new GameEventTester < BoolGameEventListener, BoolGameEvent, BoolEvent, bool >(); tester.SetActive(true); tester.RaiseGameEvent(true); Assert.AreEqual(true, tester.GetLastEventValue()); Assert.AreEqual(1, tester.GetEventCount()); tester.Clear(); tester.SetActive(false); tester.RaiseGameEvent(true); Assert.AreEqual(0, tester.GetEventCount()); }
public void ShouldRaiseIntGameEventListener() { var tester = new GameEventTester < IntGameEventListener, IntGameEvent, IntEvent, int >(); tester.SetActive(true); tester.RaiseGameEvent(10); Assert.AreEqual(10, tester.GetLastEventValue()); Assert.AreEqual(1, tester.GetEventCount()); tester.Clear(); tester.SetActive(false); tester.RaiseGameEvent(10); Assert.AreEqual(0, tester.GetEventCount()); }
public void ShouldRaiseTransformGameEventListener() { var tester = new GameEventTester < TransformGameEventListener, TransformGameEvent, TransformEvent, UnityEngine.Transform >(); tester.SetActive(true); var gameObject = new UnityEngine.GameObject(); tester.RaiseGameEvent(gameObject.transform); Assert.AreEqual(gameObject.transform, tester.GetLastEventValue()); Assert.AreEqual(1, tester.GetEventCount()); tester.Clear(); tester.SetActive(false); tester.RaiseGameEvent(gameObject.transform); Assert.AreEqual(0, tester.GetEventCount()); }