001/**
002 * This is part of HW3: Environment Setup and Java Introduction for CSE 331.
003 */
004package hw3.test;
005import hw3.*;
006
007import org.junit.Test;
008import static org.junit.Assert.*;
009
010/**
011 * HolaWorldTest is a simple test of the HolaWorld class that you
012 * are to fix.  This test just makes sure that the program
013 * does not crash and that the correct greeting is printed.
014 */
015public class HolaWorldTest {
016
017    /**
018     * Tests that HolaWorld does not crash
019     */
020    @Test
021    public void testCrash() {
022        /* Any exception thrown will be caught by JUnit. */
023        HolaWorld.main(new String[0]);
024    }
025
026    /**
027     * Tests that the HolaWorld greeting is correct.
028     */
029    @Test
030    public void testGreeting() {
031        HolaWorld world = new HolaWorld();
032        assertEquals(HolaWorld.spanishGreeting, world.getGreeting());
033    }
034
035
036}