Esempio n. 1
0
        public void CallingGetEnumeratorDirectlyOnDynamic()
        {
            dynamic array = new Clay(new ArrayBehavior(), new InterfaceProxyBehavior());

            array.Add("hello");

            IEnumerator enum1 = array.GetEnumerator();

            Assert.That(enum1.MoveNext(), Is.True);
            Assert.That(enum1.Current, Is.EqualTo("hello"));
            Assert.That(enum1.MoveNext(), Is.False);

            IEnumerator <object> enum2 = array.GetEnumerator();

            Assert.That(enum2.MoveNext(), Is.True);
            Assert.That(enum2.Current, Is.EqualTo("hello"));
            Assert.That(enum2.MoveNext(), Is.False);
        }