Skip to content

DM-7781. Moved the test class to the package matching the main class … #239

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

Merged
merged 1 commit into from
Dec 6, 2016

Conversation

ymeiymei
Copy link
Contributor

…location.

@lznakano
Copy link
Contributor

lznakano commented Nov 28, 2016

The unit test should avoid using other classes if it is possible. I would like to suggest to do the following:

  1. The best practice in junit is using setUp() method to initialize some needed variables for testing
  2. Then add a tearDown() method to nullify the variable defined in the setUp()
  3. Instead of calling

Method m = FitsRead.class.getDeclaredMethod("getZscaleValue", float[].class, ImageHeader.class, RangeValues.class);
m.setAccessible(true);

You can call

Zscale.ZscaleRetval zscaleRetval = new Zscale.ZscaleRetval(...).

Thus, you don't need FitsRead in the picture. If FitsRead has bugs, it will not affect Zscale's unit test.

@robyww robyww merged commit cddc1c5 into dev Dec 6, 2016
@robyww robyww deleted the DM-7781-JUnitTestForZscale branch December 6, 2016 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants