예제 #1
0
        public void IEnumerableFunctionality_OnNonEnumerableWrappedObject()
        {
            var reflectedObject = new ReflectedObject(42);

            try
            {
                reflectedObject.GetEnumerator().MoveNext();
                Assert.Fail("expected exception not thrown");
            }
            catch (NotSupportedException notSupportedException)
            {
                Assert.That(notSupportedException.Message, Is.EqualTo("The reflected object 'System.Int32' is not enumerable."));
            }
        }
예제 #2
0
        public void IEnumerableFunctionality_OnNonEnumerableWrappedObject()
        {
            var reflectedObject = new ReflectedObject (42);

              try
              {
            reflectedObject.GetEnumerator().MoveNext();
            Assert.Fail ("expected exception not thrown");
              }
              catch (NotSupportedException notSupportedException)
              {
            Assert.That (notSupportedException.Message, Is.EqualTo ("The reflected object 'System.Int32' is not enumerable."));
              }
        }