예제 #1
0
            public void Test()
            {
                var node = new ofRootNode();

                Assert.That(Effect, Is.EqualTo(0));
                Assert.That(Cleanup, Is.EqualTo(0));

                node.RenderElement(this);

                Assert.That(Effect, Is.EqualTo(1));
                Assert.That(Cleanup, Is.EqualTo(0));

                node.RenderElement(this);

                Assert.That(Effect, Is.EqualTo(2));
                Assert.That(Cleanup, Is.EqualTo(1));

                node.RenderElement(this);

                Assert.That(Effect, Is.EqualTo(3));
                Assert.That(Cleanup, Is.EqualTo(2));

                node.Dispose();

                Assert.That(Effect, Is.EqualTo(3));
                Assert.That(Cleanup, Is.EqualTo(3));
            }
예제 #2
0
        public void Complex()
        {
            var node = new ofRootNode();

            Assert.That(MountCounting.Mount, Is.EqualTo(0));
            Assert.That(MountCounting.Unmount, Is.EqualTo(0));

            node.RenderElement(new[]
            {
                new MountCounting("first"),
                new MountCounting("second"),
                new MountCounting("third")
            });

            Assert.That(MountCounting.Mount, Is.EqualTo(3));
            Assert.That(MountCounting.Unmount, Is.EqualTo(0));

            node.RenderElement(new[]
            {
                new MountCounting("first"),
                new MountCounting("third")
            });

            Assert.That(MountCounting.Mount, Is.EqualTo(3));
            Assert.That(MountCounting.Unmount, Is.EqualTo(1));

            node.RenderElement(new[]
            {
                new MountCounting("third"),
                new MountCounting("first")
            });

            Assert.That(MountCounting.Mount, Is.EqualTo(3));
            Assert.That(MountCounting.Unmount, Is.EqualTo(1));

            node.RenderElement(new[]
            {
                new MountCounting("third"),
                new MountCounting("second"),
                new MountCounting("first")
            });

            Assert.That(MountCounting.Mount, Is.EqualTo(4));
            Assert.That(MountCounting.Unmount, Is.EqualTo(1));

            node.RenderElement(new[]
            {
                new MountCounting("first")
            });

            Assert.That(MountCounting.Mount, Is.EqualTo(4));
            Assert.That(MountCounting.Unmount, Is.EqualTo(3));

            node.Dispose();

            Assert.That(MountCounting.Mount, Is.EqualTo(4));
            Assert.That(MountCounting.Unmount, Is.EqualTo(4));
        }
예제 #3
0
            public void Test()
            {
                var node = new ofRootNode();

                Assert.That(Disposed, Is.False);

                node.RenderElement(this);

                Assert.That(Disposed, Is.False);

                node.Dispose();

                Assert.That(Disposed, Is.True);
            }