public void InstanceFinalized_decreases_LivingCount() { var c = new InstanceCounter(); c.InstanceCreated(); c.InstanceFinalized(); Assert.AreEqual(1, c.CreatedCount); Assert.AreEqual(0, c.DisposedCount); Assert.AreEqual(1, c.FinalizedCount); Assert.AreEqual(0, c.LivingCount); }
public void Reset_resets_all_counters() { var c = new InstanceCounter(); c.InstanceCreated(); c.InstanceCreated(); c.InstanceDisposed(); c.InstanceFinalized(); c.Reset(); Assert.AreEqual(0, c.CreatedCount); Assert.AreEqual(0, c.DisposedCount); Assert.AreEqual(0, c.FinalizedCount); Assert.AreEqual(0, c.LivingCount); }