public void Clear() { var p = new RenderTargetPool(_graphicsService); var r0 = p.Obtain2D(new RenderTargetFormat(100, 100, false, SurfaceFormat.Color, DepthFormat.None)); var r1 = p.Obtain2D(new RenderTargetFormat(100, 100, false, SurfaceFormat.Color, DepthFormat.None)); p.Recycle(r0); p.Recycle(r1); //Assert.IsFalse(r0.IsDisposed); // Not disposing RT anymore because of XNA bug. //Assert.IsFalse(r1.IsDisposed); p.Clear(); //Assert.IsTrue(r0.IsDisposed); //Assert.IsTrue(r1.IsDisposed); Assert.AreEqual(0, p.RenderTargets2D.Count); Assert.AreEqual(0, p.Counters2D.Count); }