Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: refactor TestWasapiDownloader_DownloadAndValidateFile for readability #105

Open
ndushay opened this issue Jun 1, 2017 · 0 comments

Comments

@ndushay
Copy link
Contributor

ndushay commented Jun 1, 2017

refactor to WasapiDownloader.getWasapiCrawlSelector() method

(e.g. instead of inline, make this a private method:

List<Integer> desiredCrawlIds = new ArrayList<Integer>();
desiredCrawlIds.add(Integer.valueOf("666"));
PowerMockito.when(mockCrawlSelector.getSelectedCrawlIds(0)).thenReturn(desiredCrawlIds);
PowerMockito.whenNew(WasapiCrawlSelector.class).withArguments(wasapiRespList).thenReturn(mockCrawlSelector)

maybe something similar with

  • mockConnection
  • wfile creation
  • taking over System.err or System.out for testing
    (and other small tweaks that are easy and make tests more readable)
@ndushay ndushay changed the title refactor TestWasapiDownloader_DownloadAndValidateFile for readability tests: refactor TestWasapiDownloader_DownloadAndValidateFile for readability Jun 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant