I suspect your Test class is of IDisposable type and that you've neglected to show it in your sample?
If you do not call Dispose in your finalizer, Dispose() will never get called (but the object would still be freed).
Try this instead:
public class Test : IDisposable
{
public void Dispose()
{
Console.WriteLn("Dispose");
}
~Test()
{
Dispose();
}
}
Using the above example, if you don't explicitly call Dispose, the finalizer (d'tor) would still be called when the object is garbage collected (freed), hence calling Dispose().
Note the distinction between Finalizer (d'tor) and Dispose(). The gc doesn't know about IDisposable, hence it's up to you to call Dispose() in your finalizer. Also, to help the gc determine if there's a need to Finalize the object prior to 'freeing' it, you'd want to call GC.SuppressFinalize(this) in your Dispose method. For example, if you're calling Dispose() explicitly or implicitly by using "using", then the gc can skip finalizing the object again which only repeats a call to Dispose().