Exemple #1
0
        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();
        }
Exemple #2
0
        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();
        }
Exemple #3
0
 public IEnumerator Should_NotThrowAnyException_When_DiffuseMaterialIsPassed()
 {
     SafeGuard.ThrowNullReferenceExceptionWhenFieldNotInitialized(new Material(Shader.Find("Diffuse")), PlaceholderScript, "myField");
     yield return(null);
 }
Exemple #4
0
 public IEnumerator Should_NotThrowAnyException_When_ClassIsPassed()
 {
     SafeGuard.ThrowNullReferenceExceptionWhenFieldNotInitialized(new DefaultClass(), PlaceholderScript, "myField");
     yield return(null);
 }
Exemple #5
0
 public IEnumerator Should_NotThrowAnyException_When_GameObjectIsPassed()
 {
     SafeGuard.ThrowNullReferenceExceptionWhenFieldNotInitialized(new GameObject(TypeName), PlaceholderScript, "myField");
     yield return(null);
 }