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