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);        
    }

    @Test(expected=ArgumentException.class)
    public final void testEmptyZipArgs() throws ArgumentException, IOException, ZipException {
        final String args[] = { "--zip" };
        Arguments mixArgs = Arguments.checkArguments(args);
    }
    
    @Test(expected=ArgumentException.class)
    public final void testWrongZipArgs() throws ArgumentException, IOException, ZipException {
        final String args[] = { "--zip", "ghost1" };
        Arguments mixArgs = Arguments.checkArguments(args);
    }
    
}

@@ -4052,16 +4052,16 @@
 test
+Zip
 Empty
-Zip
 Args
@@ -4311,16 +4311,16 @@
 test
+Zip
 Wrong
-Zip
 Args
@@ -4426,16 +4426,597 @@
 %22ghost1%22
+ %7D;%0D%0A        Arguments mixArgs = Arguments.checkArguments(args);%0D%0A    %7D%0D%0A    %0D%0A    @Test%0D%0A    public final void testZipNoRule() throws ArgumentException, IOException, ZipException %7B%0D%0A        final String args%5B%5D = %7B %22--zip%22, getClass().getResource(%22test001.zip%22).getFile() %7D;%0D%0A        Arguments mixArgs = Arguments.checkArguments(args);%0D%0A        Assert.assertTrue(true);%0D%0A    %7D%0D%0A    %0D%0A    @Test%0D%0A    public final void testJar1Rule() throws ArgumentException, IOException, ZipException %7B%0D%0A        final String args%5B%5D = %7B %22-1%22, %22--jar%22, getClass().getResource(%22test001.jar%22).getFile()
  %7D;%0D%0A   
@@ -5065,32 +5065,66 @@
 guments(args);%0D%0A
+        Assert.assertTrue(true);%0D%0A
     %7D%0D%0A    %0D%0A%7D%0D%0A

Update BasicTest.java