unit tests for dtor contract