/**
 * Test code for MethodPractice, to be fleshed out by the student.
 *
 * TODO: add student name to this comment
 * TODO: add more tests to main
 */
public class MethodPracticeTests {

    /**
     * Print a message depending on if test passed.
     *
     * @param correct True if test counts as correct.
     */
    public static void printTest(boolean correct) {
        if (correct) {
            IO.println("Test passed");
        } else {
            IO.println("TEST FAILED!");
        }
    }

    /**
     * This code tests your program's completeness.
     *
     */
    public static void main() {
        // Some lines in this method may be over 80 chars, but I chose to
        // do that to make it easier to comment out individual
        // tests. The course coding standards still apply to the code
        // that you write in MethodPractice

        // Uncomment these tests AFTER IMPLEMENTING maxOfThree
        // IO.println("Testing maxOfThree");
        // printTest( MethodPractice.maxOfThree(1, 2, 3) == 3);
        // TODO: write more tests

        // Uncomment these tests AFTER IMPLEMENTING isVowel
        // IO.println("Testing isVowel");
        // printTest( !MethodPractice.isVowel('x') );
        // printTest( MethodPractice.isVowel('A') );
        // TODO: write more tests

        // Uncomment these tests AFTER IMPLEMENTING indexOfLastVowel
        // IO.println("Testing indexOfLastVowel");
        // printTest( MethodPractice.indexOfLastVowel("Old") == 0);
        // printTest( MethodPractice.indexOfLastVowel("rhythm and blues") == 14);
        // TODO: write more tests

        IO.println("Testing toggleCase (for char)");
        printTest( MethodPractice.toggleCase('A') == 'a');
        printTest( MethodPractice.toggleCase('m') == 'M');
        // TODO: write more tests

        IO.println("Testing toggleCase (for String)");
        printTest( MethodPractice.toggleCase("abcdeFGHIJkLMn12345^&*()").equals("ABCDEfghijKlmN12345^&*()"));
        // TODO: write more tests

        IO.println("Testing averageVowelless");
        printTest( MethodPractice.averageVowelless("", "abc", "banana", "oops", "xyz") == 1.5);
        // TODO: write more tests

        // Uncomment these tests AFTER IMPLEMENTING getTotalBill
        // IO.println("Testing getTotalBill");
        // printTest( MethodPractice.getTotalBill(120, 0.32) == 158.4);
        // TODO: write more tests

        // Uncomment these tests AFTER IMPLEMENTING solveQuadratic
        // IO.println("Testing solveQuadratic");
        // printTest( MethodPractice.solveQuadratic(0.11, -0.22, 0.033) == 1.8366600265340756);
        // TODO: write more tests

    }
}
