Files
Robot-Essentials/.templates/UtilityTest.java
T

48 lines
1.2 KiB
Java
Raw Normal View History

2020-04-11 12:39:53 -06:00
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2018-2019 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 frc4388.utility;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
import org.junit.*;
import edu.wpi.first.wpilibj.*;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
/**
* Add your docs here.
*/
public class UtilityTest {
@Test
public void testExample() {
// Arrange
boolean isFalse = false;
int i = 0;
double d = 0.0;
// Act
wait(1);
isFalse = !isFalse;
i++;
d -= Math.PI;
// Assert
assertEquals(1, i);
assertEquals(-Math.PI, d, 0.001);
assertEquals(true, isFalse);
}
private void wait(int millis) {
try {
Thread.sleep(millis);
} catch (Exception e) {}
}
}