Skip to content

Commit

Permalink
Added unit test for DetectorRegistration
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbourelly999 committed Jul 28, 2023
1 parent b6811ec commit ebeb5b2
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package org.eclipse.mosaic.interactions.detector;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;

import org.eclipse.mosaic.lib.geo.CartesianPoint;
import org.eclipse.mosaic.lib.objects.detector.Detector;
import org.eclipse.mosaic.lib.objects.detector.DetectorType;
import org.eclipse.mosaic.lib.objects.detector.Orientation;
import org.junit.Before;
import org.junit.Test;

public class DetectorRegistrationTest {
DetectorRegistration detectorRegistration;
@Before
public void setUp() throws Exception {
detectorRegistration = new DetectorRegistration(0, null);
}

@Test
public void testGetterSetterConstructor() {
Detector detector = new Detector("something", DetectorType.SEMANTIC_LIDAR, new Orientation(23.0, 0, 0),
CartesianPoint.xyz(1, 2, 3));
detectorRegistration.setDetector(detector);
assertEquals(detector, detectorRegistration.getDetector());

DetectorRegistration detectorRegistration1 = new DetectorRegistration(0, detector);

assertNotEquals(detectorRegistration, detectorRegistration1);

}
}

0 comments on commit ebeb5b2

Please sign in to comment.