added unit test for capturemethod