DELETE: template files src
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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>
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user