// Path: src/test/java/com/gikk/twirk/TestConsumer.java
// public class TestConsumer<T> {
//     private Function<T, Boolean> test;
//     private TestResult res;
// 
//     public TestResult assign(Function<T, Boolean> test){
//         this.test = test;
//         return res = new TestResult();
//     }
// 
//     public void consume(T input){
//         if(test != null) {
//             res.complete(test.apply(input));
//         }
//     }
// }
// 
// Path: src/test/java/com/gikk/twirk/TestResult.java
// public class TestResult {
//     CompletableFuture<Boolean> res = new CompletableFuture<>();
// 
//     TestResult(){ }
// 
//     void complete(boolean result){
//         res.complete(result);
//     }
// 
//     public boolean await() throws Exception {
//         return res.get(TestSuit.WAIT_TIME, TestSuit.UNIT);
//     }
// }
// 
// Path: src/main/java/com/gikk/twirk/enums/HOSTTARGET_MODE.java
// public enum HOSTTARGET_MODE { 
// 	/**Indicates that we started hosting a channel*/
// 	START, 
// 	/**Indicates that we stopped hosting a channel*/
// 	STOP }


import com.gikk.twirk.TestConsumer;
import com.gikk.twirk.TestResult;
import com.gikk.twirk.enums.HOSTTARGET_MODE;
import java.util.function.Consumer;
import static org.junit.Assert.*;
package com.gikk.twirk.types.hostTarget;



public class TestHostTarget {
	private final static String START_HOST = ":tmi.twitch.tv HOSTTARGET #gikkman :gikkbot 1";   //Gikkman host Gikkbot for 1 viewer
	private final static String STOP_HOST_NO_VIEWERS = ":tmi.twitch.tv HOSTTARGET #gikkman :-";	//Gikkbot stopped hosting for 0 viewers
	private final static String STOP_HOST_VIEWERS = ":tmi.twitch.tv HOSTTARGET #gikkman :- 5";  //Gikkbot stopped hosting for 0 viewers

	public static void test(Consumer<String> twirkInput, TestConsumer<HostTarget> test ) throws Exception{
        TestResult resStart = test.assign(TestHostTarget::testStart);
        twirkInput.accept(START_HOST);
        resStart.await();

        TestResult resStopNoView = test.assign(TestHostTarget::testStopNoView);
        twirkInput.accept(STOP_HOST_NO_VIEWERS);
        resStopNoView.await();

        TestResult resStopView = test.assign(TestHostTarget::testStopView);
        twirkInput.accept(STOP_HOST_VIEWERS);
        resStopView.await();
	}

    static boolean testStart(HostTarget host){
        doTest(host, START_HOST, HOSTTARGET_MODE.START, 1, "gikkbot" );
        System.out.println("--- --- Host Start OK");
        return true;
    }

    static boolean testStopNoView(HostTarget host){
        doTest(host, STOP_HOST_NO_VIEWERS, HOSTTARGET_MODE.STOP, 0, "" );
        System.out.println("--- --- Stop Host No Viewers OK");
        return true;
    }

// Path: src/test/java/com/gikk/twirk/TestConsumer.java
// public class TestConsumer<T> {
//     private Function<T, Boolean> test;
//     private TestResult res;
// 
//     public TestResult assign(Function<T, Boolean> test){
//         this.test = test;
//         return res = new TestResult();
//     }
// 
//     public void consume(T input){
//         if(test != null) {
//             res.complete(test.apply(input));
//         }
//     }
// }
// 
// Path: src/test/java/com/gikk/twirk/TestResult.java
// public class TestResult {
//     CompletableFuture<Boolean> res = new CompletableFuture<>();
// 
//     TestResult(){ }
// 
//     void complete(boolean result){
//         res.complete(result);
//     }
// 
//     public boolean await() throws Exception {
//         return res.get(TestSuit.WAIT_TIME, TestSuit.UNIT);
//     }
// }
// 
// Path: src/main/java/com/gikk/twirk/enums/HOSTTARGET_MODE.java
// public enum HOSTTARGET_MODE { 
// 	/**Indicates that we started hosting a channel*/
// 	START, 
// 	/**Indicates that we stopped hosting a channel*/
// 	STOP }


// Path: src/test/java/com/gikk/twirk/types/hostTarget/TestHostTarget.java
import com.gikk.twirk.TestConsumer;
import com.gikk.twirk.TestResult;
import com.gikk.twirk.enums.HOSTTARGET_MODE;
import java.util.function.Consumer;
import static org.junit.Assert.*;

package com.gikk.twirk.types.hostTarget;



public class TestHostTarget {
	private final static String START_HOST = ":tmi.twitch.tv HOSTTARGET #gikkman :gikkbot 1";   //Gikkman host Gikkbot for 1 viewer
	private final static String STOP_HOST_NO_VIEWERS = ":tmi.twitch.tv HOSTTARGET #gikkman :-";	//Gikkbot stopped hosting for 0 viewers
	private final static String STOP_HOST_VIEWERS = ":tmi.twitch.tv HOSTTARGET #gikkman :- 5";  //Gikkbot stopped hosting for 0 viewers

	public static void test(Consumer<String> twirkInput, TestConsumer<HostTarget> test ) throws Exception{
        TestResult resStart = test.assign(TestHostTarget::testStart);
        twirkInput.accept(START_HOST);
        resStart.await();

        TestResult resStopNoView = test.assign(TestHostTarget::testStopNoView);
        twirkInput.accept(STOP_HOST_NO_VIEWERS);
        resStopNoView.await();

        TestResult resStopView = test.assign(TestHostTarget::testStopView);
        twirkInput.accept(STOP_HOST_VIEWERS);
        resStopView.await();
	}

    static boolean testStart(HostTarget host){
        doTest(host, START_HOST, HOSTTARGET_MODE.START, 1, "gikkbot" );
        System.out.println("--- --- Host Start OK");
        return true;
    }

    static boolean testStopNoView(HostTarget host){
        doTest(host, STOP_HOST_NO_VIEWERS, HOSTTARGET_MODE.STOP, 0, "" );
        System.out.println("--- --- Stop Host No Viewers OK");
        return true;
    }

    static boolean testStopView(HostTarget host){