@@ -0,0 +1,1902 @@
+package de.developgroup.mrf.rover.pcf8591;%0A%0Aimport com.pi4j.io.gpio.GpioPinDigitalOutput;%0Aimport com.pi4j.io.gpio.PinState;%0Aimport org.junit.Assert;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.mockito.Mockito;%0A%0Aimport java.io.IOException;%0A%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.mockito.Mockito.when;%0A%0Apublic class IRSensorImplTest %7B%0A%0A    PCF8591ADConverter adConverter;%0A%0A    GpioPinDigitalOutput gpioPin;%0A%0A    IRSensor sensor;%0A%0A    @Before%0A    public void setUp() %7B%0A        adConverter = Mockito.mock(PCF8591ADConverter.class);%0A        gpioPin = Mockito.mock(GpioPinDigitalOutput.class);%0A        sensor = new IRSensorImpl(adConverter, PCF8591ADConverter.InputChannel.ONE, gpioPin);%0A    %7D%0A%0A    @Test%0A    public void testSwitchIrOn() %7B%0A        sensor.switchIrOn();%0A%0A        verify(gpioPin).setState(PinState.HIGH);%0A    %7D%0A%0A    @Test%0A    public void testSwitchIrOff() %7B%0A        sensor.switchIrOff();%0A%0A        verify(gpioPin).setState(PinState.LOW);%0A    %7D%0A%0A    @Test%0A    public void testGetRawReadingValueOk() throws IOException %7B%0A        when(adConverter.getChannelValue(PCF8591ADConverter.InputChannel.ONE)).thenReturn(42);%0A%0A        Assert.assertEquals(42, sensor.getRawReading());%0A    %7D%0A%0A    @Test%0A    public void testGetCompensatedPercentage() throws IOException %7B%0A        when(adConverter.getChannelValue(PCF8591ADConverter.InputChannel.ONE)).thenReturn(20, 80);%0A%0A        Assert.assertEquals(0.2543, sensor.getCompensatedPercentage(), 0.001);%0A    %7D%0A%0A    @Test%0A    public void testIsEnvironmentTooBright() throws IOException %7B%0A        when(adConverter.getChannelValue(PCF8591ADConverter.InputChannel.ONE)).thenReturn(40);%0A%0A        Assert.assertEquals(false, sensor.isEnvironmentTooBright());%0A%0A        when(adConverter.getChannelValue(PCF8591ADConverter.InputChannel.ONE)).thenReturn(240);%0A%0A        Assert.assertEquals(true, sensor.isEnvironmentTooBright());%0A    %7D%0A%7D%0A

Add test for IRSensor