Add unit test for scan dispose