// Path: src/test/java/org/mandfer/categories/FastTest.java
// public interface FastTest {}
// 
// Path: src/test/java/org/mandfer/categories/SlowTest.java
// public interface SlowTest {}


import com.pi4j.io.gpio.GpioPinDigitalMultipurpose;
import com.pi4j.io.gpio.GpioPinDigitalOutput;
import com.pi4j.io.gpio.PinMode;
import com.pi4j.io.gpio.PinState;
import com.pi4j.io.gpio.RaspiPin;
import com.pi4j.wiringpi.Gpio;
import java.util.concurrent.TimeUnit;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.mandfer.categories.FastTest;
import org.mandfer.categories.SlowTest;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

        
        verify(mocked_ADC_DIO).setMode(PinMode.DIGITAL_OUTPUT);
        verify(mocked_ADC_CS).low();
        verify(mocked_ADC_CLK, times(20)).low();
        verify(mocked_ADC_CLK, times(19)).high();
        verify(mocked_ADC_DIO, times(2)).high();
        verify(mocked_ADC_DIO).low();
        verify(mocked_ADC_DIO).setMode(PinMode.DIGITAL_INPUT);
        verify(mocked_ADC_CS).high();
    }
    
    private void prepareMockedPins() {
        when(mocked_gpioController.provisionDigitalOutputPin(RaspiPin.GPIO_00))
          .thenReturn(mocked_ADC_CS);
        when(mocked_gpioController.provisionDigitalOutputPin(RaspiPin.GPIO_01))
          .thenReturn(mocked_ADC_CLK);
        when(mocked_gpioController.provisionDigitalMultipurposePin(RaspiPin.GPIO_02, PinMode.DIGITAL_OUTPUT))
          .thenReturn(mocked_ADC_DIO);
    }
    
    
    @Test
    @Category(SlowTest.class)
    public void testMagneticFieldInteraction() throws InterruptedException {
        prepareMockedPins();
        when(mocked_ADC_DIO.getState())
          .thenReturn(// Byte dat 1
                      PinState.HIGH, //128 
                      PinState.LOW, //64
                      PinState.LOW, //32

// Path: src/test/java/org/mandfer/categories/FastTest.java
// public interface FastTest {}
// 
// Path: src/test/java/org/mandfer/categories/SlowTest.java
// public interface SlowTest {}


// Path: src/test/java/org/mandfer/sunfunpi4j/Ex02_03_LinearHallTest.java
import com.pi4j.io.gpio.GpioPinDigitalMultipurpose;
import com.pi4j.io.gpio.GpioPinDigitalOutput;
import com.pi4j.io.gpio.PinMode;
import com.pi4j.io.gpio.PinState;
import com.pi4j.io.gpio.RaspiPin;
import com.pi4j.wiringpi.Gpio;
import java.util.concurrent.TimeUnit;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.mandfer.categories.FastTest;
import org.mandfer.categories.SlowTest;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

        
        verify(mocked_ADC_DIO).setMode(PinMode.DIGITAL_OUTPUT);
        verify(mocked_ADC_CS).low();
        verify(mocked_ADC_CLK, times(20)).low();
        verify(mocked_ADC_CLK, times(19)).high();
        verify(mocked_ADC_DIO, times(2)).high();
        verify(mocked_ADC_DIO).low();
        verify(mocked_ADC_DIO).setMode(PinMode.DIGITAL_INPUT);
        verify(mocked_ADC_CS).high();
    }
    
    private void prepareMockedPins() {
        when(mocked_gpioController.provisionDigitalOutputPin(RaspiPin.GPIO_00))
          .thenReturn(mocked_ADC_CS);
        when(mocked_gpioController.provisionDigitalOutputPin(RaspiPin.GPIO_01))
          .thenReturn(mocked_ADC_CLK);
        when(mocked_gpioController.provisionDigitalMultipurposePin(RaspiPin.GPIO_02, PinMode.DIGITAL_OUTPUT))
          .thenReturn(mocked_ADC_DIO);
    }
    
    
    @Test
    @Category(SlowTest.class)
    public void testMagneticFieldInteraction() throws InterruptedException {
        prepareMockedPins();
        when(mocked_ADC_DIO.getState())
          .thenReturn(// Byte dat 1
                      PinState.HIGH, //128 
                      PinState.LOW, //64
                      PinState.LOW, //32

                      PinState.LOW, //16
