edu.udayton.udri.asset.novatel/test/edu/udayton/udri/asset/novatel/message/TestNovatelMessageParserImpl.java
@Test
    public void testParseTimeMessageDefault() throws NovatelMessageException
    {
        //verify offset is not known
        assertThat(m_SUT.isOffsetKnown(), is(false));
        //an offset of 0, will throw an exception as 0 means it isn't known
        try
        {
            m_SUT.parseInsMessage(m_InsData);
            fail("Expected exception because a time message has not been parsed to set the time offset.");
        }
        catch (NovatelMessageException e)
        {
            //expected exception
        }
        
        //adjust the time offset
        m_SUT.evaluateTimeMessage(m_TimeData);
        
        //evaluate the same message
        NovatelInsMessage messageAfterOffset = m_SUT.parseInsMessage(m_InsData);
        //Verify the time. All data is static so this value should not change. 
        //The value is the time since Jan 6, 1980 + GPS weeks + GPS Seconds with the -16 second offset from the 
        //TimeData message.
        assertThat(messageAfterOffset.getUtcTime(), is(1345334431000L));
        assertThat(m_SUT.isOffsetKnown(), is(true));
    }
/**
     * Test that the offset must be set.
     */
Test that the offset must be set.
Test that the offset must be set .
@Test
    public void testParseTimeMessageDefault() throws NovatelMessageException
    {
        assertThat(m_SUT.isOffsetKnown(), is(false));
        try
        {
            m_SUT.parseInsMessage(m_InsData);
            fail("Expected exception because a time message has not been parsed to set the time offset.");
        }
        catch (NovatelMessageException e)
        {
        }
        m_SUT.evaluateTimeMessage(m_TimeData);
        NovatelInsMessage messageAfterOffset = m_SUT.parseInsMessage(m_InsData);
        assertThat(messageAfterOffset.getUtcTime(), is(1345334431000L));
        assertThat(m_SUT.isOffsetKnown(), is(true));
    }
@ Test public void testParseTimeMessageDefault ( ) throws NovatelMessageException { assertThat ( m_SUT . isOffsetKnown ( ) , is ( false ) ) ; try { m_SUT . parseInsMessage ( m_InsData ) ; fail ( "Expected exception because a time message has not been parsed to set the time offset." ) ; } catch ( NovatelMessageException e ) { } m_SUT . evaluateTimeMessage ( m_TimeData ) ; NovatelInsMessage messageAfterOffset = m_SUT . parseInsMessage ( m_InsData ) ; assertThat ( messageAfterOffset . getUtcTime ( ) , is ( 1345334431000L ) ) ; assertThat ( m_SUT . isOffsetKnown ( ) , is ( true ) ) ; }
Test that the offset must be set.
Test that the offset must be set .
//verify offset is not known //an offset of 0, will throw an exception as 0 means it isn't known //expected exception //adjust the time offset //evaluate the same message //Verify the time. All data is static so this value should not change.  //The value is the time since Jan 6, 1980 + GPS weeks + GPS Seconds with the -16 second offset from the  //TimeData message.