package innovimax.mixthem;

import innovimax.mixthem.arguments.Arguments;
import innovimax.mixthem.arguments.ArgumentException;

import java.io.IOException;
import java.util.zip.ZipException;

import org.junit.Assert;
import org.junit.Test;

/*
    Created by innovimax-jim
    Basic tests for this application
*/
public class BasicTest {
        @Test
    public final void testPrintUsage() {
        Arguments.printUsage();
        Assert.assertTrue(true);
    }
    
    @Test(expected=ArgumentException.class)
    public final void testEmptyArgs() throws ArgumentException, IOException, ZIPException {
        final String args[] = {};
        Arguments mixArgs = Arguments.checkArguments(args);
    }

    @Test(expected=ArgumentException.class)
    public final void testWrongArgs() throws ArgumentException, IOException, ZIPException {
        final String args[] = { "ghost1", "ghost2" };
        Arguments mixArgs = Arguments.checkArguments(args);
    }

    @Test
    public final void testNoRule() throws ArgumentException, IOException, ZIPException {
        final String args[] = { getClass().getResource("test001_file1.txt").getFile(), getClass().getResource("test001_file2.txt").getFile() };
        Arguments mixArgs = Arguments.checkArguments(args);
        Assert.assertTrue(true);
    }
    @Test
    public final void test1Rule() throws ArgumentException, IOException, ZIPException {
        final String args[] = { "-1", getClass().getResource("test001_file1.txt").getFile(), getClass().getResource("test001_file2.txt").getFile() };
        Arguments mixArgs = Arguments.checkArguments(args);
        Assert.assertTrue(true);
    }
    @Test(expected=ArgumentException.class)
    public final void testUnknownRule() throws ArgumentException, IOException, ZIPException {
        final String args[] = { "-x", getClass().getResource("test001_file1.txt").getFile(), getClass().getResource("test001_file2.txt").getFile() };
        Arguments mixArgs = Arguments.checkArguments(args);
    }

    @Test(expected=ArgumentException.class)
    public final void testUnexpectedParam() throws ArgumentException, IOException, ZIPException {
        final String args[] = { "-1", "#val", getClass().getResource("test001_file1.txt").getFile(), getClass().getResource("test001_file2.txt").getFile() };
        Arguments mixArgs = Arguments.checkArguments(args);
    }

    @Test(expected=ArgumentException.class)
    public final void testWrongSeedParam() throws ArgumentException, IOException, ZIPException {
        final String args[] = { "-random-alt-line", "#val", getClass().getResource("test001_file1.txt").getFile(), getClass().getResource("test001_file2.txt").getFile() };
        Arguments mixArgs = Arguments.checkArguments(args);
    }

    @Test
    public final void testValidSeedParam() throws ArgumentException, IOException, ZIPException {
        final String args[] = { "-random-alt-line", "#1789", getClass().getResource("test001_file1.txt").getFile(), getClass().getResource("test001_file2.txt").getFile() };
        Arguments mixArgs = Arguments.checkArguments(args);
        Assert.assertTrue(true);        
    }
    
    @Test(expected=ArgumentException.class)
    public final void testNotAParam() throws ArgumentException, IOException, ZIPException {
        final String args[] = { "-random-alt-line", "1789", getClass().getResource("test001_file1.txt").getFile(), getClass().getResource("test001_file2.txt").getFile() };
        Arguments mixArgs = Arguments.checkArguments(args);
    }

    @Test
    public final void testOptionalParam() throws ArgumentException, IOException, ZIPException {
        final String args[] = { "-random-alt-line", getClass().getResource("test001_file1.txt").getFile(), getClass().getResource("test001_file2.txt").getFile() };
        Arguments mixArgs = Arguments.checkArguments(args);
        Assert.assertTrue(true);        
    }
    
}

@@ -600,34 +600,34 @@
 , IOException, Z
-IP
+ip
 Exception %7B%0D%0A   
@@ -843,34 +843,34 @@
 , IOException, Z
-IP
+ip
 Exception %7B%0D%0A   
@@ -1069,34 +1069,34 @@
 , IOException, Z
-IP
+ip
 Exception %7B%0D%0A   
@@ -1416,34 +1416,34 @@
 , IOException, Z
-IP
+ip
 Exception %7B%0D%0A   
@@ -1809,34 +1809,34 @@
 , IOException, Z
-IP
+ip
 Exception %7B%0D%0A   
@@ -2546,34 +2546,34 @@
 , IOException, Z
-IP
+ip
 Exception %7B%0D%0A   
@@ -2898,34 +2898,34 @@
 , IOException, Z
-IP
+ip
 Exception %7B%0D%0A   
@@ -3326,34 +3326,34 @@
 , IOException, Z
-IP
+ip
 Exception %7B%0D%0A   
@@ -3677,34 +3677,34 @@
 , IOException, Z
-IP
+ip
 Exception %7B%0D%0A   

Update BasicTest.java