// 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 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 com.pi4j.io.gpio.GpioPinDigitalInput;
import com.pi4j.io.gpio.GpioPinDigitalOutput;
import com.pi4j.io.gpio.PinState;
import com.pi4j.io.gpio.RaspiPin;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.mandfer.categories.FastTest;
import org.mandfer.categories.SlowTest;

    @Category(FastTest.class)
    public void verifySetup(){
        sketch.setup(NO_ARGS);
        
        verify(mocked_gpioController).provisionDigitalInputPin(RaspiPin.GPIO_00);
        verify(mocked_gpioController).provisionDigitalOutputPin(RaspiPin.GPIO_01);
        verifyNoMoreInteractions(mocked_gpioController);
    }
    
    @Test
    @Category(SlowTest.class)
    public void testNotMagneticFieldInteraction() throws InterruptedException {
        prepareMockedPins();                
        when(mocked_hallPin.isLow()).thenReturn(false);
        
        sketch.setup(NO_ARGS);
        sketch.setSketchInterruption();
        sketch.loop();
        
        verify(mocked_ledPin).setState(PinState.LOW);
        verify(mocked_hallPin).isLow();
        verifyNoMoreInteractions(mocked_hallPin, mocked_ledPin);
    }
    private void prepareMockedPins() {
        when(mocked_gpioController.provisionDigitalInputPin(RaspiPin.GPIO_00)).thenReturn(mocked_hallPin);
        when(mocked_gpioController.provisionDigitalOutputPin(RaspiPin.GPIO_01)).thenReturn(mocked_ledPin);
    }
    
    
    @Test

// 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/Ex01_SwitchHallTest.java
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 com.pi4j.io.gpio.GpioPinDigitalInput;
import com.pi4j.io.gpio.GpioPinDigitalOutput;
import com.pi4j.io.gpio.PinState;
import com.pi4j.io.gpio.RaspiPin;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.mandfer.categories.FastTest;
import org.mandfer.categories.SlowTest;

    @Category(FastTest.class)
    public void verifySetup(){
        sketch.setup(NO_ARGS);
        
        verify(mocked_gpioController).provisionDigitalInputPin(RaspiPin.GPIO_00);
        verify(mocked_gpioController).provisionDigitalOutputPin(RaspiPin.GPIO_01);
        verifyNoMoreInteractions(mocked_gpioController);
    }
    
    @Test
    @Category(SlowTest.class)
    public void testNotMagneticFieldInteraction() throws InterruptedException {
        prepareMockedPins();                
        when(mocked_hallPin.isLow()).thenReturn(false);
        
        sketch.setup(NO_ARGS);
        sketch.setSketchInterruption();
        sketch.loop();
        
        verify(mocked_ledPin).setState(PinState.LOW);
        verify(mocked_hallPin).isLow();
        verifyNoMoreInteractions(mocked_hallPin, mocked_ledPin);
    }
    private void prepareMockedPins() {
        when(mocked_gpioController.provisionDigitalInputPin(RaspiPin.GPIO_00)).thenReturn(mocked_hallPin);
        when(mocked_gpioController.provisionDigitalOutputPin(RaspiPin.GPIO_01)).thenReturn(mocked_ledPin);
    }
    
    
    @Test

    @Category(SlowTest.class)
