Package com.mobiletheatertech.plot

Source Code of com.mobiletheatertech.plot.MainTest

package com.mobiletheatertech.plot;

import mockit.Expectations;
import org.testng.annotations.Test;

/**
* @author dhs
* @since 0.0.1
*/
public class MainTest {

    public MainTest() {
    }

    @Test(expectedExceptions = ArgumentException.class,
          expectedExceptionsMessageRegExp = "Not enough arguments")
    public void noArgument() throws Exception {
        String[] args = new String[0];
        Main.main( args );
    }

    @Test(expectedExceptions = ArgumentException.class,
          expectedExceptionsMessageRegExp = "Too many arguments")
    public void tooManyArguments() throws Exception {
        String[] args = new String[]{ "Fiddle", "Faddle" };
        Main.main( args );
    }

    @Test
    public void invokesReadAndWrite() throws Exception {
        new Expectations() {
            {
                new Read( "Fiddle-Faddle" );
                Write write = new Write();
                write.init( "Fiddle-Faddle" );
            }
        };
        String[] args = new String[]{ "Fiddle-Faddle" };
        Main.main( args );
    }

}
TOP

Related Classes of com.mobiletheatertech.plot.MainTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.