DELETE: template files src

This commit is contained in:
mlwauben
2019-03-04 17:03:08 +01:00
parent 5c314e22d4
commit dfc797fab2
4 changed files with 0 additions and 106 deletions

View File

@@ -1,36 +0,0 @@
package grade;
import java.util.stream.IntStream;
public class ProjectGrade {
/**
* Returns a grade depending on if you used git and the project compiles.
* @param usedGit true if git was used
* @param compiles true if the project compiled
* @param grade grade calculated from the rubric
* @return grade
*/
public static double calculateGrade(boolean usedGit, boolean compiles, double grade) {
if (!usedGit || !compiles) {
return 1.0;
}
return grade;
}
public static boolean usesLambda() {
return IntStream.of(0, 2, 4, 6, 8, 10).map(i -> i * i)
.allMatch(i -> (i + 1) % 2 == 1);
}
/**
* Tells you when the ta is happy.
* @param bringCake true if you brought cake
* @return happyness of the TA
*/
public static boolean taIsHappy(boolean bringCake) {
return bringCake;
}
}

View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/java" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@@ -1,48 +0,0 @@
package grade;
import org.junit.Assert;
import org.junit.Test;
public class ProjectGradeTest {
private static final double DELTA = 0.001;
@Test
public void getGoodGradeIfCorrect() {
double grade = ProjectGrade.calculateGrade(true, true, 7.5);
Assert.assertEquals(7.5, grade, DELTA);
}
@Test
public void getBadGradeIfNotCompiles() {
double grade = ProjectGrade.calculateGrade(true, false, 7.5);
Assert.assertEquals(1, grade, DELTA);
}
@Test
public void getBadGradeIfNotUsedGit() {
double grade = ProjectGrade.calculateGrade(false, true, 7.5);
Assert.assertEquals(1, grade, DELTA);
}
@Test
public void testTaIsNotHappy() {
Assert.assertFalse(ProjectGrade.taIsHappy(false));
}
@Test
public void testTaIsHappy() {
Assert.assertTrue(ProjectGrade.taIsHappy(true));
}
@Test
public void testIsUsingLambda() {
Assert.assertTrue(ProjectGrade.usesLambda());
}
}

View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/java" isTestSource="true" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>