Skip to content

Commit

Permalink
Correct general test
Browse files Browse the repository at this point in the history
  • Loading branch information
liamskydamien authored and aykborstelmann committed Nov 22, 2019
1 parent 07e1e14 commit ab40bed
Showing 1 changed file with 14 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static org.assertj.core.api.Assertions.*;
import static org.mockito.Mockito.*;

import java.util.Arrays;
import java.util.Collections;
import java.util.Optional;

Expand Down Expand Up @@ -113,51 +114,45 @@ public void test_calculation_high_jump() {

assertThat(integer).isEqualTo(479);
}
/*


@Test
public void test_calculation_general() {
Student student = new Student();
student.setFemale(false);
List <SportResult> sportResults = null;
assert sportResults != null;

SportResult resultRUN_100 = new SportResult();
SportResult resultRUN_100 = new SportResult();
resultRUN_100.setDiscipline(DisciplineType.RUN_100);
resultRUN_100.setResult(12.00F);
sportResults.append(resultRUN_100);

SportResult resultRUN_800 = new SportResult();
resultRUN_800.setDiscipline(DisciplineType.RUN_800);
resultRUN_800.setResult(210.00F);
sportResults.add(resultRUN_800);

SportResult resultJUMP = new SportResult();
resultJUMP.setDiscipline(DisciplineType.LONG_JUMP);
resultJUMP.setResult(4.20F);
sportResults.add(resultJUMP);

SportResult resultTHROW_200 = new SportResult();
resultTHROW_200.setDiscipline(DisciplineType.BALL_THROWING_200);
resultTHROW_200.setResult(35.00F);
sportResults.add(resultTHROW_200);

doReturn(Optional.of(student)).when(studentRepository).findById(1L);
doReturn(Opitonal.of(sportResults)).when(sportResultRepository).findByStudent(student);
doReturn(Arrays.asList(resultJUMP, resultRUN_100, resultRUN_800, resultTHROW_200)).when(sportResultRepository).findByStudent(student);

doReturn(4.00620).when(calculationInformationService).getAValue(true, DisciplineType.RUN_100);
doReturn(2.02320).when(calculationInformationService).getAValue(true, DisciplineType.RUN_800);
doReturn(1.09350).when(calculationInformationService).getAValue(true, DisciplineType.LONG_JUMP);
doReturn(1.41490).when(calculationInformationService).getAValue(true, DisciplineType.BALL_THROWING_200);
doReturn(4.00620).when(calculationInformationService).getAValue(false, DisciplineType.RUN_100);
doReturn(2.02320).when(calculationInformationService).getAValue(false, DisciplineType.RUN_800);
doReturn(1.09350).when(calculationInformationService).getAValue(false, DisciplineType.LONG_JUMP);
doReturn(1.41490).when(calculationInformationService).getAValue(false, DisciplineType.BALL_THROWING_200);

doReturn(0.00656).when(calculationInformationService).getCValue(true, DisciplineType.RUN_100);
doReturn(0.00647).when(calculationInformationService).getCValue(true, DisciplineType.RUN_800);
doReturn(0.00208).when(calculationInformationService).getCValue(true, DisciplineType.LONG_JUMP);
doReturn(0.01039).when(calculationInformationService).getCValue(true, DisciplineType.BALL_THROWING_200);
doReturn(0.00656).when(calculationInformationService).getCValue(false, DisciplineType.RUN_100);
doReturn(0.00647).when(calculationInformationService).getCValue(false, DisciplineType.RUN_800);
doReturn(0.00208).when(calculationInformationService).getCValue(false, DisciplineType.LONG_JUMP);
doReturn(0.01039).when(calculationInformationService).getCValue(false, DisciplineType.BALL_THROWING_200);

Integer integer = studentScoreController.calculateScore(1L);

assertThat(integer).isEqual(1803);
assertThat(integer).isEqualTo(1802);
}
*/

}

0 comments on commit ab40bed

Please sign in to comment.