public IEnumerator Should_ThrowArgumentException_When_OwnerWasNotSet() { // Important note: LogAssert did not seem to work here try { SafeGuard.ThrowNullReferenceExceptionWhenFieldNotInitialized(null, null, "myField"); } catch (ArgumentException exception) { Debug.Log(exception); Assert.Pass(); } yield return(null); Assert.Fail(); }
public IEnumerator Should_ThrowNullReferenceException_When_NullIsPassed() { // Important note: LogAssert did not seem to work here try { SafeGuard.ThrowNullReferenceExceptionWhenFieldNotInitialized(null, PlaceholderScript, "myField"); } catch (NullReferenceException exception) { Debug.Log(exception); Assert.Pass(); } yield return(null); Assert.Fail(); }
public IEnumerator Should_NotThrowAnyException_When_DiffuseMaterialIsPassed() { SafeGuard.ThrowNullReferenceExceptionWhenFieldNotInitialized(new Material(Shader.Find("Diffuse")), PlaceholderScript, "myField"); yield return(null); }
public IEnumerator Should_NotThrowAnyException_When_ClassIsPassed() { SafeGuard.ThrowNullReferenceExceptionWhenFieldNotInitialized(new DefaultClass(), PlaceholderScript, "myField"); yield return(null); }
public IEnumerator Should_NotThrowAnyException_When_GameObjectIsPassed() { SafeGuard.ThrowNullReferenceExceptionWhenFieldNotInitialized(new GameObject(TypeName), PlaceholderScript, "myField"); yield return(null); }