// 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/CLEARCHAT_MODE.java
// public enum CLEARCHAT_MODE{ 
// 	/** A user has been purged/banned
// 	 */
// 	USER, 
// 	
// 	/** The entire chat has been pruged
// 	 */
// 	COMPLETE };


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



public class TestClearChat {
	private static final String COMPLETE = ":tmi.twitch.tv CLEARCHAT #gikkman";
	private static final String DURATION_NO_REASON = "@ban-duration=20;ban-reason= :tmi.twitch.tv CLEARCHAT #gikkman :gikkbot";
	private static final String NO_DURATION_NO_REASON = "@ban-reason= :tmi.twitch.tv CLEARCHAT #gikkman :gikkbot";
	private static final String DURATION_REASON = "@ban-duration=10;ban-reason=Bad :tmi.twitch.tv CLEARCHAT #gikkman :gikkbot";
	private static final String NO_DURATION_REASON = "@ban-reason=Bad\\sargument :tmi.twitch.tv CLEARCHAT #gikkman :gikkbot";

	public static void test(Consumer<String> twirkInput, TestConsumer<ClearChat> test ) throws Exception{
        TestResult resComplete = test.assign(TestClearChat::testComplete);
		twirkInput.accept(COMPLETE);
        resComplete.await();

        TestResult resDNR = test.assign(TestClearChat::testDurationNoReason);
		twirkInput.accept(DURATION_NO_REASON);
        resDNR.await();

        TestResult resNDNR = test.assign(TestClearChat::testNoDurationNoReason);
		twirkInput.accept(NO_DURATION_NO_REASON);
        resNDNR.await();

        TestResult resDR = test.assign(TestClearChat::testDurationReason);
		twirkInput.accept(DURATION_REASON);
        resDR.await();

        TestResult resNDR = test.assign(TestClearChat::testNoDurationReason);
		twirkInput.accept(NO_DURATION_REASON);
        resNDR.await();
	}

    static boolean testComplete(ClearChat c){
        test(c, CLEARCHAT_MODE.COMPLETE, "", -1, "");
// 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/CLEARCHAT_MODE.java
// public enum CLEARCHAT_MODE{ 
// 	/** A user has been purged/banned
// 	 */
// 	USER, 
// 	
// 	/** The entire chat has been pruged
// 	 */
// 	COMPLETE };


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

package com.gikk.twirk.types.clearChat;



public class TestClearChat {
	private static final String COMPLETE = ":tmi.twitch.tv CLEARCHAT #gikkman";
	private static final String DURATION_NO_REASON = "@ban-duration=20;ban-reason= :tmi.twitch.tv CLEARCHAT #gikkman :gikkbot";
	private static final String NO_DURATION_NO_REASON = "@ban-reason= :tmi.twitch.tv CLEARCHAT #gikkman :gikkbot";
	private static final String DURATION_REASON = "@ban-duration=10;ban-reason=Bad :tmi.twitch.tv CLEARCHAT #gikkman :gikkbot";
	private static final String NO_DURATION_REASON = "@ban-reason=Bad\\sargument :tmi.twitch.tv CLEARCHAT #gikkman :gikkbot";

	public static void test(Consumer<String> twirkInput, TestConsumer<ClearChat> test ) throws Exception{
        TestResult resComplete = test.assign(TestClearChat::testComplete);
		twirkInput.accept(COMPLETE);
        resComplete.await();

        TestResult resDNR = test.assign(TestClearChat::testDurationNoReason);
		twirkInput.accept(DURATION_NO_REASON);
        resDNR.await();

        TestResult resNDNR = test.assign(TestClearChat::testNoDurationNoReason);
		twirkInput.accept(NO_DURATION_NO_REASON);
        resNDNR.await();

        TestResult resDR = test.assign(TestClearChat::testDurationReason);
		twirkInput.accept(DURATION_REASON);
        resDR.await();

        TestResult resNDR = test.assign(TestClearChat::testNoDurationReason);
		twirkInput.accept(NO_DURATION_REASON);
        resNDR.await();
	}

    static boolean testComplete(ClearChat c){
        test(c, CLEARCHAT_MODE.COMPLETE, "", -1, "");
        System.out.println("--- --- Complete clear OK");