public void OutScoM() { // Use the Assert class to test conditions. BreakingEffect BE = new BreakingEffect(); // If user input Mu with out of scope value. Get the exception invalid mu. Assert.Catch <System.Exception>(() => BE.InputVerify(5, (float)99, GameObject.Find("TargetObj"))); }
public void NonNumMu() { // Use the Assert class to test conditions. BreakingEffect BE = new BreakingEffect(); // If user input mu as non-number value, Unity will consider it as 0 by default. Get the same exception invalid mu. Assert.Catch <System.Exception>(() => BE.InputVerify(5, (float)0, GameObject.Find("TargetObj"))); }
public void NoObj() { // Use the Assert class to test conditions. BreakingEffect BE = new BreakingEffect(); //Input a "null" target object Assert.Catch <System.NullReferenceException>(() => BE.InputVerify(5, (float)0.2, GameObject.Find("Null"))); }
public void NoExpLv() { // Use the Assert class to test conditions. BreakingEffect BE = new BreakingEffect(); // If user does not input E, Unity will consider it as 0 by default. Get the same exception invalid E. Assert.Catch <System.Exception>(() => BE.InputVerify(0, (float)0.2, GameObject.Find("TargetObj"))); }
public void OutScoC() { // Use the Assert class to test conditions. BreakingEffect BE = new BreakingEffect(); // Create a target object that has invalid coordinates. GameObject GO = new GameObject(); GO.transform.position = new Vector3(0, 99999, 0); Assert.Catch <System.Exception>(() => BE.InputVerify(5, (float)0.2, GO)); }