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