// 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/main/java/org/mandfer/sunfunpi4j/RGB_Base.java
// public static final int LEDPINBLUE = 2;
// 
// Path: src/main/java/org/mandfer/sunfunpi4j/RGB_Base.java
// public static final int LEDPINGREEN = 1;
// 
// Path: src/main/java/org/mandfer/sunfunpi4j/RGB_Base.java
// public static final int LEDPINRED = 0;


import static org.mandfer.sunfunpi4j.RGB_Base.LEDPINGREEN;
import static org.mandfer.sunfunpi4j.RGB_Base.LEDPINRED;
import static org.mockito.Mockito.atLeast;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import com.pi4j.wiringpi.Gpio;
import com.pi4j.wiringpi.SoftPwm;
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.mandfer.sunfunpi4j.RGB_Base.LEDPINBLUE;

    public void setUp(){
        PowerMockito.mockStatic(Gpio.class);
        PowerMockito.mockStatic(SoftPwm.class);        
        sketch = new Ex04_RGB(mocked_gpioController);
    }
    
    @Test
    @Category(FastTest.class)
    public void verifySetup(){
        sketch.setup(NO_ARGS);
        
        PowerMockito.verifyStatic();
        Gpio.wiringPiSetup();
        
        PowerMockito.verifyStatic();
        SoftPwm.softPwmCreate(LEDPINRED, 0, 100);
        PowerMockito.verifyStatic();
        SoftPwm.softPwmCreate(LEDPINGREEN, 0, 100);
        PowerMockito.verifyStatic();
        SoftPwm.softPwmCreate(LEDPINBLUE, 0, 100);        
    }    
    
    @Test
    @Category(SlowTest.class)
    public void turnOffLedBeforeFinishSketch() throws InterruptedException{
        sketch.setup(NO_ARGS);
        sketch.setSketchInterruption();
        sketch.loop();
        
        PowerMockito.verifyStatic(atLeast(1));

// 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/main/java/org/mandfer/sunfunpi4j/RGB_Base.java
// public static final int LEDPINBLUE = 2;
// 
// Path: src/main/java/org/mandfer/sunfunpi4j/RGB_Base.java
// public static final int LEDPINGREEN = 1;
// 
// Path: src/main/java/org/mandfer/sunfunpi4j/RGB_Base.java
// public static final int LEDPINRED = 0;


// Path: src/test/java/org/mandfer/sunfunpi4j/Ex04_RGBTest.java
import static org.mandfer.sunfunpi4j.RGB_Base.LEDPINGREEN;
import static org.mandfer.sunfunpi4j.RGB_Base.LEDPINRED;
import static org.mockito.Mockito.atLeast;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import com.pi4j.wiringpi.Gpio;
import com.pi4j.wiringpi.SoftPwm;
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.mandfer.sunfunpi4j.RGB_Base.LEDPINBLUE;

    public void setUp(){
        PowerMockito.mockStatic(Gpio.class);
        PowerMockito.mockStatic(SoftPwm.class);        
        sketch = new Ex04_RGB(mocked_gpioController);
    }
    
    @Test
    @Category(FastTest.class)
    public void verifySetup(){
        sketch.setup(NO_ARGS);
        
        PowerMockito.verifyStatic();
        Gpio.wiringPiSetup();
        
        PowerMockito.verifyStatic();
        SoftPwm.softPwmCreate(LEDPINRED, 0, 100);
        PowerMockito.verifyStatic();
        SoftPwm.softPwmCreate(LEDPINGREEN, 0, 100);
        PowerMockito.verifyStatic();
        SoftPwm.softPwmCreate(LEDPINBLUE, 0, 100);        
    }    
    
    @Test
    @Category(SlowTest.class)
    public void turnOffLedBeforeFinishSketch() throws InterruptedException{
        sketch.setup(NO_ARGS);
        sketch.setSketchInterruption();
        sketch.loop();
        
        PowerMockito.verifyStatic(atLeast(1));

        SoftPwm.softPwmWrite(LEDPINRED, 0);
