File tree Expand file tree Collapse file tree 5 files changed +62
-11
lines changed
Expand file tree Collapse file tree 5 files changed +62
-11
lines changed Original file line number Diff line number Diff line change 1+ name : Autograding Tests
2+ ' on ' :
3+ - push
4+ - repository_dispatch
5+ permissions :
6+ checks : write
7+ actions : read
8+ contents : read
9+ jobs :
10+ run-autograding-tests :
11+ runs-on : ubuntu-latest
12+ if : github.actor != 'github-classroom[bot]'
13+ steps :
14+ - name : Checkout code
15+ uses : actions/checkout@v4
16+ - name : test
17+ id : test
18+ uses : classroom-resources/autograding-command-grader@v1
19+ with :
20+ test-name : test
21+ setup-command : ' '
22+ command : gradle test --tests "APLineTest.test"
23+ timeout : 10
24+ max-score : 1
25+ - name : Autograding Reporter
26+ uses : classroom-resources/autograding-grading-reporter@v1
27+ env :
28+ TEST_RESULTS : " ${{steps.test.outputs.result}}"
29+ with :
30+ runners : test
Original file line number Diff line number Diff line change 1+ package org .APCSLowell ;
2+
3+ public class APLine {
4+ int a , b , c ;
5+ public APLine (int a , int b , int c ) {}
6+ public boolean isOnLine (int x , int y ) {
7+ return a * x + b * y + c == 0 ;
8+ }
9+ public double getSlope () {
10+ return -(double )a / (double )b ;
11+ }
12+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ package org .APCSLowell ;
2+
3+ import org .junit .Test ;
4+ import static org .junit .Assert .*;
5+
6+ public class APLineTest {
7+ @ Test
8+ public void test () {
9+ APLine line1 = new APLine (5 ,4 ,-17 );
10+ double slope1 = line1 .getSlope ();
11+ assertEquals (slope1 ,-1.25 ,0.01 );
12+ boolean onLine1 = line1 .isOnLine (5 ,-2 );
13+ assertEquals (onLine1 ,true );
14+ APLine line2 = new APLine (-25 ,40 ,30 );
15+ double slope2 = line2 .getSlope ();
16+ assertEquals (slope2 ,0.625 ,0.01 );
17+ boolean onLine2 = line2 .isOnLine (5 ,-2 );
18+ assertEquals (onLine2 ,false );
19+ }
20+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments