-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathHatchIntakeTest.java
51 lines (36 loc) · 1.59 KB
/
HatchIntakeTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
package frc;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import edu.wpi.first.wpilibj.Solenoid;
import frc.robot.subsystems.intakes.HatchSubsystem;
/**
* Hatch Intake JUnit tests
*/
public class HatchIntakeTest {
@Test
public void hatchIntakeTestTrue() {
// -------- Hatch Subsystem Test 1 --------
HatchSubsystem hatchSubsystem = new HatchSubsystem(new Solenoid(0), true);
hatchSubsystem.enablePiston();
assertEquals(hatchSubsystem.getStatus(), true);
hatchSubsystem.disablePiston();
assertEquals(hatchSubsystem.getStatus(), false);
hatchSubsystem.close();
}
@Test
public void hatchIntakeTestFalse() {
// -------- Hatch Subsystem Test 2 --------
HatchSubsystem hatchSubsystem = new HatchSubsystem(new Solenoid(1), false);
hatchSubsystem.enablePiston();
assertEquals(hatchSubsystem.getStatus(), false);
hatchSubsystem.disablePiston();
assertEquals(hatchSubsystem.getStatus(), true);
hatchSubsystem.close();
}
}