import java.util.*;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Unit test suite
*/
public class QueryBoardTest {
/**
* Test case 1
*/
@Test
public void testRows() {
QueryBoard board = new QueryBoard();
for(int i = 0; i < QueryBoard.SIZE; i++) {
board.setNums(0, i, 10);
assertEquals(board.queryNums(0, i), 2560);
}
}
}
/**
* Sample class file for above unit tests
*/
public class QueryBoard {
int[] nums;
QueryBoard() {
nums = new int[10];
}
public void setNums(int min, int max, int step) {
for (int i = min; ( i < nums.length() && ( i <= max ) ); i++) {
nums[i] = i;
}
}
public int queryNums(int min, int max) {
int result = 0;
for (int i = min; ( i < nums.length() && ( i <= max ) ); i++) {
result += i;
}
return result;
}
}