dispose is working with test cases.