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)); }
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)); }
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); }