/** \file
 *
 *  Contains the test cases for the CodedStr class
 *
 *  Copyright (c) 2007,2008,2009 MBARI
 *  MBARI Proprietary Information.  All Rights Reserved
 */

#ifndef _CODEDSTR_TEST_H_
#define _CODEDSTR_TEST_H_

#include "utils/CodedStr.h"
#include "utils/Str.h"

#include <cxxtest/TestSuite.h>

/**
 * %Units tests for class CodedStr
 *
 * \ingroup utils
 */
class CodedStr_Test : public CxxTest::TestSuite
{
public:

    /// CodedStr::Read %Unit Test
    void testRead( void )
    {
        Str str( " code=0026 name=\"DVL_micro\"\n" );
        StrIOStream strIOStream( str );

        CodedStr* codedStr = CodedStr::Read( strIOStream );
        TS_ASSERT( NULL != codedStr );
        if( NULL != codedStr )
        {
            TS_ASSERT_EQUALS( codedStr->getCode(), 0x0026 );
            TS_ASSERT_SAME_DATA( codedStr->cStr(), "DVL_micro", 10 );
            delete codedStr;
        }

    }
};

#endif // _CODEDSTR_TEST_H
