@Test public void should_return_right_base_matrix() throws Exception { application.setElementValues(QuestionsMock.getMockAllOverLimit()); Integer[] baseMatrix = application.getElementValues(); Assert.assertEquals(baseMatrix[0].intValue(), 14); Assert.assertEquals(baseMatrix[1].intValue(), 4); }
@Test public void should_equalize_base_matrix_condition_01() throws Exception { application.setElementValues(QuestionsMock.getMockTestCondition01()); application.equalizeElements(); Integer[] equalizedMatrix = application.getElementValues(); Assert.assertEquals(equalizedMatrix[0].intValue(), 2); Assert.assertEquals(equalizedMatrix[1].intValue(), 2); Assert.assertEquals(equalizedMatrix[2].intValue(), 5); }
@Test public void should_return_rigth_size() throws Exception { application.setElementValues(QuestionsMock.getMockAllGood()); Assert.assertEquals(application.getQuestionsSize().intValue(), 9); }
@Test public void should_return_in_the_limit() throws Exception { application.setElementValues(QuestionsMock.getMockAllGood()); Assert.assertFalse(application.isQuestionsOverLimit()); }
@Test public void should_return_not_over_limit() throws Exception { application.setElementValues(QuestionsMock.getMockLessQuestions()); Assert.assertFalse(application.isQuestionsOverLimit()); }
@Test public void should_return_is_over_limit() throws Exception { application.setElementValues(QuestionsMock.getMockAllOverLimit()); Assert.assertTrue(application.isQuestionsOverLimit()); }
@Test public void should_return_signup_questions_over_limit() throws Exception { Integer[] overLimit = getOverLimitElements(QuestionsMock.getMockSignupOverLimit()); Assert.assertEquals(overLimit[0].intValue(), 0); }
@Test public void should_return_all_questions_over_limit() throws Exception { Integer[] overLimit = getOverLimitElements(QuestionsMock.getMockAllOverLimit()); Assert.assertEquals(overLimit.length, 2); }