File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
src/test/java/com/thealgorithms/physics Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 11package com .thealgorithms .physics ;
22
3- import static org .junit .jupiter .api .Assertions .*;
3+ import static org .junit .jupiter .api .Assertions .assertDoesNotThrow ;
4+ import static org .junit .jupiter .api .Assertions .assertEquals ;
5+ import static org .junit .jupiter .api .Assertions .assertThrows ;
6+
47import org .junit .jupiter .api .Test ;
58
69public class SnellLawTest {
710
811 @ Test
912 public void testRefractedAngle () {
10- double n1 = 1.0 ; // air
11- double n2 = 1.5 ; // glass
13+ double n1 = 1.0 ; // air
14+ double n2 = 1.5 ; // glass
1215 double theta1 = Math .toRadians (30 );
1316
1417 double theta2 = SnellLaw .refractedAngle (n1 , n2 , theta1 );
@@ -20,10 +23,9 @@ public void testRefractedAngle() {
2023
2124 @ Test
2225 public void testTotalInternalReflection () {
23- // total internal reflection happens when n1 > n2 AND theta1 is large
2426 double n1 = 1.5 ;
2527 double n2 = 1.0 ;
26- double theta1 = Math .toRadians (60 ); // large enough angle
28+ double theta1 = Math .toRadians (60 ); // large angle
2729
2830 assertThrows (IllegalArgumentException .class , () -> {
2931 SnellLaw .refractedAngle (n1 , n2 , theta1 );
You can’t perform that action at this time.
0 commit comments