mil.dod.th.ose.gui.webapp/test/mil/dod/th/ose/gui/webapp/mp/TestMissionProgramMgrImpl.java
@Test
    public void testGetLocalMissionNames()
    {
        //mock program objects
        Program prog1 = mock(Program.class);
        when(prog1.getProgramName()).thenReturn("Larry");
        Program prog2 = mock(Program.class);
        when(prog2.getProgramName()).thenReturn("Bob");
        Program prog3 = mock(Program.class);
        when(prog3.getProgramName()).thenReturn("James");

        //set of programs to return
        Set<Program> programs = new HashSet<Program>();
        programs.add(prog1);
        programs.add(prog2);
        programs.add(prog3);

        //mock behavior of mission program manager
        when(m_MPManager.getPrograms()).thenReturn(programs);

        //verify
        assertThat(m_SUT.getLocalMissionNames(), hasItems("Larry", "Bob", "James"));
    }
/**
     * Test get local program names.
     * 
     * Verify that the mission program manager is called to return a set of program objects.
     */
Test get local program names.

Verify that the mission program manager is called to return a set of program objects.
Test get local program names . Verify that the mission program manager is called to return a set of program objects .
@Test
    public void testGetLocalMissionNames()
    {
        Program prog1 = mock(Program.class);
        when(prog1.getProgramName()).thenReturn("Larry");
        Program prog2 = mock(Program.class);
        when(prog2.getProgramName()).thenReturn("Bob");
        Program prog3 = mock(Program.class);
        when(prog3.getProgramName()).thenReturn("James");
        Set<Program> programs = new HashSet<Program>();
        programs.add(prog1);
        programs.add(prog2);
        programs.add(prog3);
        when(m_MPManager.getPrograms()).thenReturn(programs);
        assertThat(m_SUT.getLocalMissionNames(), hasItems("Larry", "Bob", "James"));
    }
@ Test public void testGetLocalMissionNames ( ) { Program prog1 = mock ( Program . class ) ; when ( prog1 . getProgramName ( ) ) . thenReturn ( "Larry" ) ; Program prog2 = mock ( Program . class ) ; when ( prog2 . getProgramName ( ) ) . thenReturn ( "Bob" ) ; Program prog3 = mock ( Program . class ) ; when ( prog3 . getProgramName ( ) ) . thenReturn ( "James" ) ; Set < Program > programs = new HashSet < Program > ( ) ; programs . add ( prog1 ) ; programs . add ( prog2 ) ; programs . add ( prog3 ) ; when ( m_MPManager . getPrograms ( ) ) . thenReturn ( programs ) ; assertThat ( m_SUT . getLocalMissionNames ( ) , hasItems ( "Larry" , "Bob" , "James" ) ) ; }
Test get local program names.
Test get local program names .
//mock program objects //set of programs to return //mock behavior of mission program manager //verify